{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "1. [计算布尔数据](#%E8%AE%A1%E7%AE%97%E5%B8%83%E5%B0%94%E6%95%B0%E6%8D%AE)\n",
    "2. [构造多个布尔条件](#%E6%9E%84%E9%80%A0%E5%A4%9A%E4%B8%AA%E5%B8%83%E5%B0%94%E6%9D%A1%E4%BB%B6)\n",
    "3. [使用布尔索引过滤数据](#%E4%BD%BF%E7%94%A8%E5%B8%83%E5%B0%94%E7%B4%A2%E5%BC%95%E8%BF%87%E6%BB%A4%E6%95%B0%E6%8D%AE)\n",
    "4. [使用布尔索引复制索引选择](#%E4%BD%BF%E7%94%A8%E5%B8%83%E5%B0%94%E7%B4%A2%E5%BC%95%E5%A4%8D%E5%88%B6%E7%B4%A2%E5%BC%95%E9%80%89%E6%8B%A9)\n",
    "5. [选取不重复的，排序的索引](#%E9%80%89%E5%8F%96%E4%B8%8D%E9%87%8D%E5%A4%8D%E7%9A%84%EF%BC%8C%E6%8E%92%E5%BA%8F%E7%9A%84%E7%B4%A2%E5%BC%95)\n",
    "6. [股价分析](#%E8%82%A1%E4%BB%B7%E5%88%86%E6%9E%90)\n",
    "7. [实现SQL的where语句](#%E5%AE%9E%E7%8E%B0SQL%E7%9A%84where%E8%AF%AD%E5%8F%A5)\n",
    "8. [股票收益归一化统计](#%E8%82%A1%E7%A5%A8%E6%94%B6%E7%9B%8A%E5%BD%92%E4%B8%80%E5%8C%96%E7%BB%9F%E8%AE%A1)\n",
    "9. [改进使用布尔索引查询代码的可读性](#%E6%94%B9%E8%BF%9B%E4%BD%BF%E7%94%A8%E5%B8%83%E5%B0%94%E7%B4%A2%E5%BC%95%E6%9F%A5%E8%AF%A2%E4%BB%A3%E7%A0%81%E7%9A%84%E5%8F%AF%E8%AF%BB%E6%80%A7)\n",
    "10. [where查询返回Series](#where%E6%9F%A5%E8%AF%A2%E8%BF%94%E5%9B%9ESeries)\n",
    "11. [使用mask函数按行处理数据](#%E4%BD%BF%E7%94%A8mask%E5%87%BD%E6%95%B0%E6%8C%89%E8%A1%8C%E5%A4%84%E7%90%86%E6%95%B0%E6%8D%AE)\n",
    "12. [使用布尔，下标或名字索引定位元素](#%E4%BD%BF%E7%94%A8%E5%B8%83%E5%B0%94%EF%BC%8C%E4%B8%8B%E6%A0%87%E6%88%96%E5%90%8D%E5%AD%97%E7%B4%A2%E5%BC%95%E5%AE%9A%E4%BD%8D%E5%85%83%E7%B4%A0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 计算布尔数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "pd.options.display.max_columns = 50"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>color</th>\n",
       "      <th>director_name</th>\n",
       "      <th>num_critic_for_reviews</th>\n",
       "      <th>duration</th>\n",
       "      <th>director_facebook_likes</th>\n",
       "      <th>actor_3_facebook_likes</th>\n",
       "      <th>actor_2_name</th>\n",
       "      <th>actor_1_facebook_likes</th>\n",
       "      <th>gross</th>\n",
       "      <th>genres</th>\n",
       "      <th>actor_1_name</th>\n",
       "      <th>num_voted_users</th>\n",
       "      <th>cast_total_facebook_likes</th>\n",
       "      <th>actor_3_name</th>\n",
       "      <th>facenumber_in_poster</th>\n",
       "      <th>plot_keywords</th>\n",
       "      <th>movie_imdb_link</th>\n",
       "      <th>num_user_for_reviews</th>\n",
       "      <th>language</th>\n",
       "      <th>country</th>\n",
       "      <th>content_rating</th>\n",
       "      <th>budget</th>\n",
       "      <th>title_year</th>\n",
       "      <th>actor_2_facebook_likes</th>\n",
       "      <th>imdb_score</th>\n",
       "      <th>aspect_ratio</th>\n",
       "      <th>movie_facebook_likes</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>movie_title</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Avatar</th>\n",
       "      <td>Color</td>\n",
       "      <td>James Cameron</td>\n",
       "      <td>723.0</td>\n",
       "      <td>178.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>855.0</td>\n",
       "      <td>Joel David Moore</td>\n",
       "      <td>1000.0</td>\n",
       "      <td>760505847.0</td>\n",
       "      <td>Action|Adventure|Fantasy|Sci-Fi</td>\n",
       "      <td>CCH Pounder</td>\n",
       "      <td>886204</td>\n",
       "      <td>4834</td>\n",
       "      <td>Wes Studi</td>\n",
       "      <td>0.0</td>\n",
       "      <td>avatar|future|marine|native|paraplegic</td>\n",
       "      <td>http://www.imdb.com/title/tt0499549/?ref_=fn_t...</td>\n",
       "      <td>3054.0</td>\n",
       "      <td>English</td>\n",
       "      <td>USA</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>237000000.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>936.0</td>\n",
       "      <td>7.9</td>\n",
       "      <td>1.78</td>\n",
       "      <td>33000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Pirates of the Caribbean: At World's End</th>\n",
       "      <td>Color</td>\n",
       "      <td>Gore Verbinski</td>\n",
       "      <td>302.0</td>\n",
       "      <td>169.0</td>\n",
       "      <td>563.0</td>\n",
       "      <td>1000.0</td>\n",
       "      <td>Orlando Bloom</td>\n",
       "      <td>40000.0</td>\n",
       "      <td>309404152.0</td>\n",
       "      <td>Action|Adventure|Fantasy</td>\n",
       "      <td>Johnny Depp</td>\n",
       "      <td>471220</td>\n",
       "      <td>48350</td>\n",
       "      <td>Jack Davenport</td>\n",
       "      <td>0.0</td>\n",
       "      <td>goddess|marriage ceremony|marriage proposal|pi...</td>\n",
       "      <td>http://www.imdb.com/title/tt0449088/?ref_=fn_t...</td>\n",
       "      <td>1238.0</td>\n",
       "      <td>English</td>\n",
       "      <td>USA</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>300000000.0</td>\n",
       "      <td>2007.0</td>\n",
       "      <td>5000.0</td>\n",
       "      <td>7.1</td>\n",
       "      <td>2.35</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Spectre</th>\n",
       "      <td>Color</td>\n",
       "      <td>Sam Mendes</td>\n",
       "      <td>602.0</td>\n",
       "      <td>148.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>161.0</td>\n",
       "      <td>Rory Kinnear</td>\n",
       "      <td>11000.0</td>\n",
       "      <td>200074175.0</td>\n",
       "      <td>Action|Adventure|Thriller</td>\n",
       "      <td>Christoph Waltz</td>\n",
       "      <td>275868</td>\n",
       "      <td>11700</td>\n",
       "      <td>Stephanie Sigman</td>\n",
       "      <td>1.0</td>\n",
       "      <td>bomb|espionage|sequel|spy|terrorist</td>\n",
       "      <td>http://www.imdb.com/title/tt2379713/?ref_=fn_t...</td>\n",
       "      <td>994.0</td>\n",
       "      <td>English</td>\n",
       "      <td>UK</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>245000000.0</td>\n",
       "      <td>2015.0</td>\n",
       "      <td>393.0</td>\n",
       "      <td>6.8</td>\n",
       "      <td>2.35</td>\n",
       "      <td>85000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>The Dark Knight Rises</th>\n",
       "      <td>Color</td>\n",
       "      <td>Christopher Nolan</td>\n",
       "      <td>813.0</td>\n",
       "      <td>164.0</td>\n",
       "      <td>22000.0</td>\n",
       "      <td>23000.0</td>\n",
       "      <td>Christian Bale</td>\n",
       "      <td>27000.0</td>\n",
       "      <td>448130642.0</td>\n",
       "      <td>Action|Thriller</td>\n",
       "      <td>Tom Hardy</td>\n",
       "      <td>1144337</td>\n",
       "      <td>106759</td>\n",
       "      <td>Joseph Gordon-Levitt</td>\n",
       "      <td>0.0</td>\n",
       "      <td>deception|imprisonment|lawlessness|police offi...</td>\n",
       "      <td>http://www.imdb.com/title/tt1345836/?ref_=fn_t...</td>\n",
       "      <td>2701.0</td>\n",
       "      <td>English</td>\n",
       "      <td>USA</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>250000000.0</td>\n",
       "      <td>2012.0</td>\n",
       "      <td>23000.0</td>\n",
       "      <td>8.5</td>\n",
       "      <td>2.35</td>\n",
       "      <td>164000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Star Wars: Episode VII - The Force Awakens</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Doug Walker</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>131.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Rob Walker</td>\n",
       "      <td>131.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Documentary</td>\n",
       "      <td>Doug Walker</td>\n",
       "      <td>8</td>\n",
       "      <td>143</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>http://www.imdb.com/title/tt5289954/?ref_=fn_t...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>12.0</td>\n",
       "      <td>7.1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                            color      director_name  \\\n",
       "movie_title                                                            \n",
       "Avatar                                      Color      James Cameron   \n",
       "Pirates of the Caribbean: At World's End    Color     Gore Verbinski   \n",
       "Spectre                                     Color         Sam Mendes   \n",
       "The Dark Knight Rises                       Color  Christopher Nolan   \n",
       "Star Wars: Episode VII - The Force Awakens    NaN        Doug Walker   \n",
       "\n",
       "                                            num_critic_for_reviews  duration  \\\n",
       "movie_title                                                                    \n",
       "Avatar                                                       723.0     178.0   \n",
       "Pirates of the Caribbean: At World's End                     302.0     169.0   \n",
       "Spectre                                                      602.0     148.0   \n",
       "The Dark Knight Rises                                        813.0     164.0   \n",
       "Star Wars: Episode VII - The Force Awakens                     NaN       NaN   \n",
       "\n",
       "                                            director_facebook_likes  \\\n",
       "movie_title                                                           \n",
       "Avatar                                                          0.0   \n",
       "Pirates of the Caribbean: At World's End                      563.0   \n",
       "Spectre                                                         0.0   \n",
       "The Dark Knight Rises                                       22000.0   \n",
       "Star Wars: Episode VII - The Force Awakens                    131.0   \n",
       "\n",
       "                                            actor_3_facebook_likes  \\\n",
       "movie_title                                                          \n",
       "Avatar                                                       855.0   \n",
       "Pirates of the Caribbean: At World's End                    1000.0   \n",
       "Spectre                                                      161.0   \n",
       "The Dark Knight Rises                                      23000.0   \n",
       "Star Wars: Episode VII - The Force Awakens                     NaN   \n",
       "\n",
       "                                                actor_2_name  \\\n",
       "movie_title                                                    \n",
       "Avatar                                      Joel David Moore   \n",
       "Pirates of the Caribbean: At World's End       Orlando Bloom   \n",
       "Spectre                                         Rory Kinnear   \n",
       "The Dark Knight Rises                         Christian Bale   \n",
       "Star Wars: Episode VII - The Force Awakens        Rob Walker   \n",
       "\n",
       "                                            actor_1_facebook_likes  \\\n",
       "movie_title                                                          \n",
       "Avatar                                                      1000.0   \n",
       "Pirates of the Caribbean: At World's End                   40000.0   \n",
       "Spectre                                                    11000.0   \n",
       "The Dark Knight Rises                                      27000.0   \n",
       "Star Wars: Episode VII - The Force Awakens                   131.0   \n",
       "\n",
       "                                                  gross  \\\n",
       "movie_title                                               \n",
       "Avatar                                      760505847.0   \n",
       "Pirates of the Caribbean: At World's End    309404152.0   \n",
       "Spectre                                     200074175.0   \n",
       "The Dark Knight Rises                       448130642.0   \n",
       "Star Wars: Episode VII - The Force Awakens          NaN   \n",
       "\n",
       "                                                                     genres  \\\n",
       "movie_title                                                                   \n",
       "Avatar                                      Action|Adventure|Fantasy|Sci-Fi   \n",
       "Pirates of the Caribbean: At World's End           Action|Adventure|Fantasy   \n",
       "Spectre                                           Action|Adventure|Thriller   \n",
       "The Dark Knight Rises                                       Action|Thriller   \n",
       "Star Wars: Episode VII - The Force Awakens                      Documentary   \n",
       "\n",
       "                                               actor_1_name  num_voted_users  \\\n",
       "movie_title                                                                    \n",
       "Avatar                                          CCH Pounder           886204   \n",
       "Pirates of the Caribbean: At World's End        Johnny Depp           471220   \n",
       "Spectre                                     Christoph Waltz           275868   \n",
       "The Dark Knight Rises                             Tom Hardy          1144337   \n",
       "Star Wars: Episode VII - The Force Awakens      Doug Walker                8   \n",
       "\n",
       "                                            cast_total_facebook_likes  \\\n",
       "movie_title                                                             \n",
       "Avatar                                                           4834   \n",
       "Pirates of the Caribbean: At World's End                        48350   \n",
       "Spectre                                                         11700   \n",
       "The Dark Knight Rises                                          106759   \n",
       "Star Wars: Episode VII - The Force Awakens                        143   \n",
       "\n",
       "                                                    actor_3_name  \\\n",
       "movie_title                                                        \n",
       "Avatar                                                 Wes Studi   \n",
       "Pirates of the Caribbean: At World's End          Jack Davenport   \n",
       "Spectre                                         Stephanie Sigman   \n",
       "The Dark Knight Rises                       Joseph Gordon-Levitt   \n",
       "Star Wars: Episode VII - The Force Awakens                   NaN   \n",
       "\n",
       "                                            facenumber_in_poster  \\\n",
       "movie_title                                                        \n",
       "Avatar                                                       0.0   \n",
       "Pirates of the Caribbean: At World's End                     0.0   \n",
       "Spectre                                                      1.0   \n",
       "The Dark Knight Rises                                        0.0   \n",
       "Star Wars: Episode VII - The Force Awakens                   0.0   \n",
       "\n",
       "                                                                                plot_keywords  \\\n",
       "movie_title                                                                                     \n",
       "Avatar                                                 avatar|future|marine|native|paraplegic   \n",
       "Pirates of the Caribbean: At World's End    goddess|marriage ceremony|marriage proposal|pi...   \n",
       "Spectre                                                   bomb|espionage|sequel|spy|terrorist   \n",
       "The Dark Knight Rises                       deception|imprisonment|lawlessness|police offi...   \n",
       "Star Wars: Episode VII - The Force Awakens                                                NaN   \n",
       "\n",
       "                                                                              movie_imdb_link  \\\n",
       "movie_title                                                                                     \n",
       "Avatar                                      http://www.imdb.com/title/tt0499549/?ref_=fn_t...   \n",
       "Pirates of the Caribbean: At World's End    http://www.imdb.com/title/tt0449088/?ref_=fn_t...   \n",
       "Spectre                                     http://www.imdb.com/title/tt2379713/?ref_=fn_t...   \n",
       "The Dark Knight Rises                       http://www.imdb.com/title/tt1345836/?ref_=fn_t...   \n",
       "Star Wars: Episode VII - The Force Awakens  http://www.imdb.com/title/tt5289954/?ref_=fn_t...   \n",
       "\n",
       "                                            num_user_for_reviews language  \\\n",
       "movie_title                                                                 \n",
       "Avatar                                                    3054.0  English   \n",
       "Pirates of the Caribbean: At World's End                  1238.0  English   \n",
       "Spectre                                                    994.0  English   \n",
       "The Dark Knight Rises                                     2701.0  English   \n",
       "Star Wars: Episode VII - The Force Awakens                   NaN      NaN   \n",
       "\n",
       "                                           country content_rating  \\\n",
       "movie_title                                                         \n",
       "Avatar                                         USA          PG-13   \n",
       "Pirates of the Caribbean: At World's End       USA          PG-13   \n",
       "Spectre                                         UK          PG-13   \n",
       "The Dark Knight Rises                          USA          PG-13   \n",
       "Star Wars: Episode VII - The Force Awakens     NaN            NaN   \n",
       "\n",
       "                                                 budget  title_year  \\\n",
       "movie_title                                                           \n",
       "Avatar                                      237000000.0      2009.0   \n",
       "Pirates of the Caribbean: At World's End    300000000.0      2007.0   \n",
       "Spectre                                     245000000.0      2015.0   \n",
       "The Dark Knight Rises                       250000000.0      2012.0   \n",
       "Star Wars: Episode VII - The Force Awakens          NaN         NaN   \n",
       "\n",
       "                                            actor_2_facebook_likes  \\\n",
       "movie_title                                                          \n",
       "Avatar                                                       936.0   \n",
       "Pirates of the Caribbean: At World's End                    5000.0   \n",
       "Spectre                                                      393.0   \n",
       "The Dark Knight Rises                                      23000.0   \n",
       "Star Wars: Episode VII - The Force Awakens                    12.0   \n",
       "\n",
       "                                            imdb_score  aspect_ratio  \\\n",
       "movie_title                                                            \n",
       "Avatar                                             7.9          1.78   \n",
       "Pirates of the Caribbean: At World's End           7.1          2.35   \n",
       "Spectre                                            6.8          2.35   \n",
       "The Dark Knight Rises                              8.5          2.35   \n",
       "Star Wars: Episode VII - The Force Awakens         7.1           NaN   \n",
       "\n",
       "                                            movie_facebook_likes  \n",
       "movie_title                                                       \n",
       "Avatar                                                     33000  \n",
       "Pirates of the Caribbean: At World's End                       0  \n",
       "Spectre                                                    85000  \n",
       "The Dark Knight Rises                                     164000  \n",
       "Star Wars: Episode VII - The Force Awakens                     0  "
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "movie = pd.read_csv('data/movie.csv', index_col='movie_title')\n",
    "movie.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "movie_title\n",
       "Avatar                                         True\n",
       "Pirates of the Caribbean: At World's End       True\n",
       "Spectre                                        True\n",
       "The Dark Knight Rises                          True\n",
       "Star Wars: Episode VII - The Force Awakens    False\n",
       "John Carter                                    True\n",
       "Spider-Man 3                                   True\n",
       "Tangled                                       False\n",
       "Avengers: Age of Ultron                        True\n",
       "Harry Potter and the Half-Blood Prince         True\n",
       "Name: duration, dtype: bool"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "movie_2_hours = movie['duration'] > 120 # 对列的每一个值与120进行比较\n",
    "movie_2_hours.head(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1039"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "movie_2_hours.sum() # True的数量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.2113506916192026"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "movie_2_hours.mean() # 大约21%的值是True"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "count      4916\n",
       "unique        2\n",
       "top       False\n",
       "freq       3877\n",
       "Name: duration, dtype: object"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'''\n",
    "count      4916 总共4916条数据\n",
    "unique        2 True/False两个值\n",
    "top       False False的值最多\n",
    "freq       3877 3877条False, 1039条True。\n",
    "'''\n",
    "movie_2_hours.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.21199755152009794"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "movie['duration'].dropna().gt(120).mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False    0.788649\n",
       "True     0.211351\n",
       "Name: duration, dtype: float64"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "movie_2_hours.value_counts(normalize=True) # normalize即归一，总量是一，计算各个值的比例。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.9777687130328371"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "actors = movie[['actor_1_facebook_likes', 'actor_2_facebook_likes']].dropna()\n",
    "(actors['actor_1_facebook_likes'] > actors['actor_2_facebook_likes']).mean() # 1号受欢迎超过2号的比例"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 构造多个布尔条件"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>color</th>\n",
       "      <th>director_name</th>\n",
       "      <th>num_critic_for_reviews</th>\n",
       "      <th>duration</th>\n",
       "      <th>director_facebook_likes</th>\n",
       "      <th>actor_3_facebook_likes</th>\n",
       "      <th>actor_2_name</th>\n",
       "      <th>actor_1_facebook_likes</th>\n",
       "      <th>gross</th>\n",
       "      <th>genres</th>\n",
       "      <th>actor_1_name</th>\n",
       "      <th>num_voted_users</th>\n",
       "      <th>cast_total_facebook_likes</th>\n",
       "      <th>actor_3_name</th>\n",
       "      <th>facenumber_in_poster</th>\n",
       "      <th>plot_keywords</th>\n",
       "      <th>movie_imdb_link</th>\n",
       "      <th>num_user_for_reviews</th>\n",
       "      <th>language</th>\n",
       "      <th>country</th>\n",
       "      <th>content_rating</th>\n",
       "      <th>budget</th>\n",
       "      <th>title_year</th>\n",
       "      <th>actor_2_facebook_likes</th>\n",
       "      <th>imdb_score</th>\n",
       "      <th>aspect_ratio</th>\n",
       "      <th>movie_facebook_likes</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>movie_title</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Avatar</th>\n",
       "      <td>Color</td>\n",
       "      <td>James Cameron</td>\n",
       "      <td>723.0</td>\n",
       "      <td>178.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>855.0</td>\n",
       "      <td>Joel David Moore</td>\n",
       "      <td>1000.0</td>\n",
       "      <td>760505847.0</td>\n",
       "      <td>Action|Adventure|Fantasy|Sci-Fi</td>\n",
       "      <td>CCH Pounder</td>\n",
       "      <td>886204</td>\n",
       "      <td>4834</td>\n",
       "      <td>Wes Studi</td>\n",
       "      <td>0.0</td>\n",
       "      <td>avatar|future|marine|native|paraplegic</td>\n",
       "      <td>http://www.imdb.com/title/tt0499549/?ref_=fn_t...</td>\n",
       "      <td>3054.0</td>\n",
       "      <td>English</td>\n",
       "      <td>USA</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>237000000.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>936.0</td>\n",
       "      <td>7.9</td>\n",
       "      <td>1.78</td>\n",
       "      <td>33000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Pirates of the Caribbean: At World's End</th>\n",
       "      <td>Color</td>\n",
       "      <td>Gore Verbinski</td>\n",
       "      <td>302.0</td>\n",
       "      <td>169.0</td>\n",
       "      <td>563.0</td>\n",
       "      <td>1000.0</td>\n",
       "      <td>Orlando Bloom</td>\n",
       "      <td>40000.0</td>\n",
       "      <td>309404152.0</td>\n",
       "      <td>Action|Adventure|Fantasy</td>\n",
       "      <td>Johnny Depp</td>\n",
       "      <td>471220</td>\n",
       "      <td>48350</td>\n",
       "      <td>Jack Davenport</td>\n",
       "      <td>0.0</td>\n",
       "      <td>goddess|marriage ceremony|marriage proposal|pi...</td>\n",
       "      <td>http://www.imdb.com/title/tt0449088/?ref_=fn_t...</td>\n",
       "      <td>1238.0</td>\n",
       "      <td>English</td>\n",
       "      <td>USA</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>300000000.0</td>\n",
       "      <td>2007.0</td>\n",
       "      <td>5000.0</td>\n",
       "      <td>7.1</td>\n",
       "      <td>2.35</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Spectre</th>\n",
       "      <td>Color</td>\n",
       "      <td>Sam Mendes</td>\n",
       "      <td>602.0</td>\n",
       "      <td>148.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>161.0</td>\n",
       "      <td>Rory Kinnear</td>\n",
       "      <td>11000.0</td>\n",
       "      <td>200074175.0</td>\n",
       "      <td>Action|Adventure|Thriller</td>\n",
       "      <td>Christoph Waltz</td>\n",
       "      <td>275868</td>\n",
       "      <td>11700</td>\n",
       "      <td>Stephanie Sigman</td>\n",
       "      <td>1.0</td>\n",
       "      <td>bomb|espionage|sequel|spy|terrorist</td>\n",
       "      <td>http://www.imdb.com/title/tt2379713/?ref_=fn_t...</td>\n",
       "      <td>994.0</td>\n",
       "      <td>English</td>\n",
       "      <td>UK</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>245000000.0</td>\n",
       "      <td>2015.0</td>\n",
       "      <td>393.0</td>\n",
       "      <td>6.8</td>\n",
       "      <td>2.35</td>\n",
       "      <td>85000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>The Dark Knight Rises</th>\n",
       "      <td>Color</td>\n",
       "      <td>Christopher Nolan</td>\n",
       "      <td>813.0</td>\n",
       "      <td>164.0</td>\n",
       "      <td>22000.0</td>\n",
       "      <td>23000.0</td>\n",
       "      <td>Christian Bale</td>\n",
       "      <td>27000.0</td>\n",
       "      <td>448130642.0</td>\n",
       "      <td>Action|Thriller</td>\n",
       "      <td>Tom Hardy</td>\n",
       "      <td>1144337</td>\n",
       "      <td>106759</td>\n",
       "      <td>Joseph Gordon-Levitt</td>\n",
       "      <td>0.0</td>\n",
       "      <td>deception|imprisonment|lawlessness|police offi...</td>\n",
       "      <td>http://www.imdb.com/title/tt1345836/?ref_=fn_t...</td>\n",
       "      <td>2701.0</td>\n",
       "      <td>English</td>\n",
       "      <td>USA</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>250000000.0</td>\n",
       "      <td>2012.0</td>\n",
       "      <td>23000.0</td>\n",
       "      <td>8.5</td>\n",
       "      <td>2.35</td>\n",
       "      <td>164000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Star Wars: Episode VII - The Force Awakens</th>\n",
       "      <td>NaN</td>\n",
       "      <td>Doug Walker</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>131.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Rob Walker</td>\n",
       "      <td>131.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Documentary</td>\n",
       "      <td>Doug Walker</td>\n",
       "      <td>8</td>\n",
       "      <td>143</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>http://www.imdb.com/title/tt5289954/?ref_=fn_t...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>12.0</td>\n",
       "      <td>7.1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                            color      director_name  \\\n",
       "movie_title                                                            \n",
       "Avatar                                      Color      James Cameron   \n",
       "Pirates of the Caribbean: At World's End    Color     Gore Verbinski   \n",
       "Spectre                                     Color         Sam Mendes   \n",
       "The Dark Knight Rises                       Color  Christopher Nolan   \n",
       "Star Wars: Episode VII - The Force Awakens    NaN        Doug Walker   \n",
       "\n",
       "                                            num_critic_for_reviews  duration  \\\n",
       "movie_title                                                                    \n",
       "Avatar                                                       723.0     178.0   \n",
       "Pirates of the Caribbean: At World's End                     302.0     169.0   \n",
       "Spectre                                                      602.0     148.0   \n",
       "The Dark Knight Rises                                        813.0     164.0   \n",
       "Star Wars: Episode VII - The Force Awakens                     NaN       NaN   \n",
       "\n",
       "                                            director_facebook_likes  \\\n",
       "movie_title                                                           \n",
       "Avatar                                                          0.0   \n",
       "Pirates of the Caribbean: At World's End                      563.0   \n",
       "Spectre                                                         0.0   \n",
       "The Dark Knight Rises                                       22000.0   \n",
       "Star Wars: Episode VII - The Force Awakens                    131.0   \n",
       "\n",
       "                                            actor_3_facebook_likes  \\\n",
       "movie_title                                                          \n",
       "Avatar                                                       855.0   \n",
       "Pirates of the Caribbean: At World's End                    1000.0   \n",
       "Spectre                                                      161.0   \n",
       "The Dark Knight Rises                                      23000.0   \n",
       "Star Wars: Episode VII - The Force Awakens                     NaN   \n",
       "\n",
       "                                                actor_2_name  \\\n",
       "movie_title                                                    \n",
       "Avatar                                      Joel David Moore   \n",
       "Pirates of the Caribbean: At World's End       Orlando Bloom   \n",
       "Spectre                                         Rory Kinnear   \n",
       "The Dark Knight Rises                         Christian Bale   \n",
       "Star Wars: Episode VII - The Force Awakens        Rob Walker   \n",
       "\n",
       "                                            actor_1_facebook_likes  \\\n",
       "movie_title                                                          \n",
       "Avatar                                                      1000.0   \n",
       "Pirates of the Caribbean: At World's End                   40000.0   \n",
       "Spectre                                                    11000.0   \n",
       "The Dark Knight Rises                                      27000.0   \n",
       "Star Wars: Episode VII - The Force Awakens                   131.0   \n",
       "\n",
       "                                                  gross  \\\n",
       "movie_title                                               \n",
       "Avatar                                      760505847.0   \n",
       "Pirates of the Caribbean: At World's End    309404152.0   \n",
       "Spectre                                     200074175.0   \n",
       "The Dark Knight Rises                       448130642.0   \n",
       "Star Wars: Episode VII - The Force Awakens          NaN   \n",
       "\n",
       "                                                                     genres  \\\n",
       "movie_title                                                                   \n",
       "Avatar                                      Action|Adventure|Fantasy|Sci-Fi   \n",
       "Pirates of the Caribbean: At World's End           Action|Adventure|Fantasy   \n",
       "Spectre                                           Action|Adventure|Thriller   \n",
       "The Dark Knight Rises                                       Action|Thriller   \n",
       "Star Wars: Episode VII - The Force Awakens                      Documentary   \n",
       "\n",
       "                                               actor_1_name  num_voted_users  \\\n",
       "movie_title                                                                    \n",
       "Avatar                                          CCH Pounder           886204   \n",
       "Pirates of the Caribbean: At World's End        Johnny Depp           471220   \n",
       "Spectre                                     Christoph Waltz           275868   \n",
       "The Dark Knight Rises                             Tom Hardy          1144337   \n",
       "Star Wars: Episode VII - The Force Awakens      Doug Walker                8   \n",
       "\n",
       "                                            cast_total_facebook_likes  \\\n",
       "movie_title                                                             \n",
       "Avatar                                                           4834   \n",
       "Pirates of the Caribbean: At World's End                        48350   \n",
       "Spectre                                                         11700   \n",
       "The Dark Knight Rises                                          106759   \n",
       "Star Wars: Episode VII - The Force Awakens                        143   \n",
       "\n",
       "                                                    actor_3_name  \\\n",
       "movie_title                                                        \n",
       "Avatar                                                 Wes Studi   \n",
       "Pirates of the Caribbean: At World's End          Jack Davenport   \n",
       "Spectre                                         Stephanie Sigman   \n",
       "The Dark Knight Rises                       Joseph Gordon-Levitt   \n",
       "Star Wars: Episode VII - The Force Awakens                   NaN   \n",
       "\n",
       "                                            facenumber_in_poster  \\\n",
       "movie_title                                                        \n",
       "Avatar                                                       0.0   \n",
       "Pirates of the Caribbean: At World's End                     0.0   \n",
       "Spectre                                                      1.0   \n",
       "The Dark Knight Rises                                        0.0   \n",
       "Star Wars: Episode VII - The Force Awakens                   0.0   \n",
       "\n",
       "                                                                                plot_keywords  \\\n",
       "movie_title                                                                                     \n",
       "Avatar                                                 avatar|future|marine|native|paraplegic   \n",
       "Pirates of the Caribbean: At World's End    goddess|marriage ceremony|marriage proposal|pi...   \n",
       "Spectre                                                   bomb|espionage|sequel|spy|terrorist   \n",
       "The Dark Knight Rises                       deception|imprisonment|lawlessness|police offi...   \n",
       "Star Wars: Episode VII - The Force Awakens                                                NaN   \n",
       "\n",
       "                                                                              movie_imdb_link  \\\n",
       "movie_title                                                                                     \n",
       "Avatar                                      http://www.imdb.com/title/tt0499549/?ref_=fn_t...   \n",
       "Pirates of the Caribbean: At World's End    http://www.imdb.com/title/tt0449088/?ref_=fn_t...   \n",
       "Spectre                                     http://www.imdb.com/title/tt2379713/?ref_=fn_t...   \n",
       "The Dark Knight Rises                       http://www.imdb.com/title/tt1345836/?ref_=fn_t...   \n",
       "Star Wars: Episode VII - The Force Awakens  http://www.imdb.com/title/tt5289954/?ref_=fn_t...   \n",
       "\n",
       "                                            num_user_for_reviews language  \\\n",
       "movie_title                                                                 \n",
       "Avatar                                                    3054.0  English   \n",
       "Pirates of the Caribbean: At World's End                  1238.0  English   \n",
       "Spectre                                                    994.0  English   \n",
       "The Dark Knight Rises                                     2701.0  English   \n",
       "Star Wars: Episode VII - The Force Awakens                   NaN      NaN   \n",
       "\n",
       "                                           country content_rating  \\\n",
       "movie_title                                                         \n",
       "Avatar                                         USA          PG-13   \n",
       "Pirates of the Caribbean: At World's End       USA          PG-13   \n",
       "Spectre                                         UK          PG-13   \n",
       "The Dark Knight Rises                          USA          PG-13   \n",
       "Star Wars: Episode VII - The Force Awakens     NaN            NaN   \n",
       "\n",
       "                                                 budget  title_year  \\\n",
       "movie_title                                                           \n",
       "Avatar                                      237000000.0      2009.0   \n",
       "Pirates of the Caribbean: At World's End    300000000.0      2007.0   \n",
       "Spectre                                     245000000.0      2015.0   \n",
       "The Dark Knight Rises                       250000000.0      2012.0   \n",
       "Star Wars: Episode VII - The Force Awakens          NaN         NaN   \n",
       "\n",
       "                                            actor_2_facebook_likes  \\\n",
       "movie_title                                                          \n",
       "Avatar                                                       936.0   \n",
       "Pirates of the Caribbean: At World's End                    5000.0   \n",
       "Spectre                                                      393.0   \n",
       "The Dark Knight Rises                                      23000.0   \n",
       "Star Wars: Episode VII - The Force Awakens                    12.0   \n",
       "\n",
       "                                            imdb_score  aspect_ratio  \\\n",
       "movie_title                                                            \n",
       "Avatar                                             7.9          1.78   \n",
       "Pirates of the Caribbean: At World's End           7.1          2.35   \n",
       "Spectre                                            6.8          2.35   \n",
       "The Dark Knight Rises                              8.5          2.35   \n",
       "Star Wars: Episode VII - The Force Awakens         7.1           NaN   \n",
       "\n",
       "                                            movie_facebook_likes  \n",
       "movie_title                                                       \n",
       "Avatar                                                     33000  \n",
       "Pirates of the Caribbean: At World's End                       0  \n",
       "Spectre                                                    85000  \n",
       "The Dark Knight Rises                                     164000  \n",
       "Star Wars: Episode VII - The Force Awakens                     0  "
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "movie = pd.read_csv('data/movie.csv', index_col='movie_title')\n",
    "movie.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "movie_title\n",
       "Avatar                                         True\n",
       "Pirates of the Caribbean: At World's End       True\n",
       "Spectre                                        True\n",
       "The Dark Knight Rises                          True\n",
       "Star Wars: Episode VII - The Force Awakens    False\n",
       "Name: content_rating, dtype: bool"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "criteria1 = movie.imdb_score > 8\n",
    "criteria2 = movie.content_rating == 'PG-13'\n",
    "criteria3 = (movie.title_year < 2000) | (movie.title_year >= 2010)\n",
    "\n",
    "criteria2.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "movie_title\n",
       "Avatar                                        False\n",
       "Pirates of the Caribbean: At World's End      False\n",
       "Spectre                                       False\n",
       "The Dark Knight Rises                          True\n",
       "Star Wars: Episode VII - The Force Awakens    False\n",
       "dtype: bool"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "criteria_final = criteria1 & criteria2 & criteria3 # 每行的3个元素是否都为True\n",
    "criteria_final.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "Cannot perform 'ror_' with a dtyped [float64] array and scalar of type [bool]",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32mc:\\users\\lin\\appdata\\local\\programs\\python\\python38-32\\lib\\site-packages\\pandas\\core\\ops\\array_ops.py\u001b[0m in \u001b[0;36mna_logical_op\u001b[1;34m(x, y, op)\u001b[0m\n\u001b[0;32m    273\u001b[0m         \u001b[1;31m#  (xint or xbool) and (yint or bool)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 274\u001b[1;33m         \u001b[0mresult\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mop\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mx\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0my\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    275\u001b[0m     \u001b[1;32mexcept\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mc:\\users\\lin\\appdata\\local\\programs\\python\\python38-32\\lib\\site-packages\\pandas\\core\\ops\\roperator.py\u001b[0m in \u001b[0;36mror_\u001b[1;34m(left, right)\u001b[0m\n\u001b[0;32m     55\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mror_\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mleft\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mright\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 56\u001b[1;33m     \u001b[1;32mreturn\u001b[0m \u001b[0moperator\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mor_\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mright\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mleft\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m     57\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mTypeError\u001b[0m: ufunc 'bitwise_or' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''",
      "\nDuring handling of the above exception, another exception occurred:\n",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "\u001b[1;32mc:\\users\\lin\\appdata\\local\\programs\\python\\python38-32\\lib\\site-packages\\pandas\\core\\ops\\array_ops.py\u001b[0m in \u001b[0;36mna_logical_op\u001b[1;34m(x, y, op)\u001b[0m\n\u001b[0;32m    287\u001b[0m             \u001b[1;32mtry\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 288\u001b[1;33m                 \u001b[0mresult\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mlibops\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mscalar_binop\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mx\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0my\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mop\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    289\u001b[0m             except (\n",
      "\u001b[1;32mpandas\\_libs\\ops.pyx\u001b[0m in \u001b[0;36mpandas._libs.ops.scalar_binop\u001b[1;34m()\u001b[0m\n",
      "\u001b[1;31mValueError\u001b[0m: Buffer dtype mismatch, expected 'Python object' but got 'double'",
      "\nDuring handling of the above exception, another exception occurred:\n",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-14-7f2ef9ee2be5>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mmovie\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtitle_year\u001b[0m \u001b[1;33m<\u001b[0m \u001b[1;36m2000\u001b[0m \u001b[1;33m|\u001b[0m \u001b[0mmovie\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtitle_year\u001b[0m \u001b[1;33m>\u001b[0m \u001b[1;36m2009\u001b[0m \u001b[1;31m# 运算符顺序问题会报错，加括号就OK！\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;32mc:\\users\\lin\\appdata\\local\\programs\\python\\python38-32\\lib\\site-packages\\pandas\\core\\ops\\common.py\u001b[0m in \u001b[0;36mnew_method\u001b[1;34m(self, other)\u001b[0m\n\u001b[0;32m     62\u001b[0m         \u001b[0mother\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mitem_from_zerodim\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mother\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     63\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 64\u001b[1;33m         \u001b[1;32mreturn\u001b[0m \u001b[0mmethod\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mother\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m     65\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     66\u001b[0m     \u001b[1;32mreturn\u001b[0m \u001b[0mnew_method\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mc:\\users\\lin\\appdata\\local\\programs\\python\\python38-32\\lib\\site-packages\\pandas\\core\\ops\\__init__.py\u001b[0m in \u001b[0;36mwrapper\u001b[1;34m(self, other)\u001b[0m\n\u001b[0;32m    550\u001b[0m         \u001b[0mrvalues\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mextract_array\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mother\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mextract_numpy\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mTrue\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    551\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 552\u001b[1;33m         \u001b[0mres_values\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mlogical_op\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mlvalues\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mrvalues\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mop\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    553\u001b[0m         \u001b[1;32mreturn\u001b[0m \u001b[0m_construct_result\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mres_values\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mindex\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mindex\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mname\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mres_name\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    554\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mc:\\users\\lin\\appdata\\local\\programs\\python\\python38-32\\lib\\site-packages\\pandas\\core\\ops\\array_ops.py\u001b[0m in \u001b[0;36mlogical_op\u001b[1;34m(left, right, op)\u001b[0m\n\u001b[0;32m    364\u001b[0m         \u001b[0mfiller\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mfill_int\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mis_self_int_dtype\u001b[0m \u001b[1;32mand\u001b[0m \u001b[0mis_other_int_dtype\u001b[0m \u001b[1;32melse\u001b[0m \u001b[0mfill_bool\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    365\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 366\u001b[1;33m         \u001b[0mres_values\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mna_logical_op\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mlvalues\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mrvalues\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mop\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    367\u001b[0m         \u001b[0mres_values\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mfiller\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mres_values\u001b[0m\u001b[1;33m)\u001b[0m  \u001b[1;31m# type: ignore\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    368\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mc:\\users\\lin\\appdata\\local\\programs\\python\\python38-32\\lib\\site-packages\\pandas\\core\\ops\\array_ops.py\u001b[0m in \u001b[0;36mna_logical_op\u001b[1;34m(x, y, op)\u001b[0m\n\u001b[0;32m    295\u001b[0m             ):\n\u001b[0;32m    296\u001b[0m                 \u001b[0mtyp\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mtype\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0my\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m__name__\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 297\u001b[1;33m                 raise TypeError(\n\u001b[0m\u001b[0;32m    298\u001b[0m                     \u001b[1;34mf\"Cannot perform '{op.__name__}' with a dtyped [{x.dtype}] array \"\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    299\u001b[0m                     \u001b[1;34mf\"and scalar of type [{typ}]\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mTypeError\u001b[0m: Cannot perform 'ror_' with a dtyped [float64] array and scalar of type [bool]"
     ]
    }
   ],
   "source": [
    "movie.title_year < 2000 | movie.title_year > 2009 # 运算符顺序问题会报错，加括号就OK！"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(movie.title_year < 2000) | (movie.title_year > 2009) # 有一列数据为True就是True"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 使用布尔索引过滤数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "movie = pd.read_csv('data/movie.csv', index_col='movie_title')\n",
    "\n",
    "crit_a1 = movie.imdb_score > 8\n",
    "crit_a2 = movie.content_rating == 'PG-13'\n",
    "crit_a3 = (movie.title_year < 2000) | (movie.title_year > 2009)\n",
    "final_crit_a = crit_a1 & crit_a2 & crit_a3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "crit_b1 = movie.imdb_score < 5\n",
    "crit_b2 = movie.content_rating == 'R'\n",
    "crit_b3 = (movie.title_year >= 2000) & (movie.title_year <= 2010)\n",
    "final_crit_b = crit_b1 & crit_b2 & crit_b3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "movie_title\n",
       "Avatar                                        False\n",
       "Pirates of the Caribbean: At World's End      False\n",
       "Spectre                                       False\n",
       "The Dark Knight Rises                          True\n",
       "Star Wars: Episode VII - The Force Awakens    False\n",
       "dtype: bool"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "final_crit_all = final_crit_a | final_crit_b\n",
    "final_crit_all.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>color</th>\n",
       "      <th>director_name</th>\n",
       "      <th>num_critic_for_reviews</th>\n",
       "      <th>duration</th>\n",
       "      <th>director_facebook_likes</th>\n",
       "      <th>actor_3_facebook_likes</th>\n",
       "      <th>actor_2_name</th>\n",
       "      <th>actor_1_facebook_likes</th>\n",
       "      <th>gross</th>\n",
       "      <th>genres</th>\n",
       "      <th>actor_1_name</th>\n",
       "      <th>num_voted_users</th>\n",
       "      <th>cast_total_facebook_likes</th>\n",
       "      <th>actor_3_name</th>\n",
       "      <th>facenumber_in_poster</th>\n",
       "      <th>plot_keywords</th>\n",
       "      <th>movie_imdb_link</th>\n",
       "      <th>num_user_for_reviews</th>\n",
       "      <th>language</th>\n",
       "      <th>country</th>\n",
       "      <th>content_rating</th>\n",
       "      <th>budget</th>\n",
       "      <th>title_year</th>\n",
       "      <th>actor_2_facebook_likes</th>\n",
       "      <th>imdb_score</th>\n",
       "      <th>aspect_ratio</th>\n",
       "      <th>movie_facebook_likes</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>movie_title</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>The Dark Knight Rises</th>\n",
       "      <td>Color</td>\n",
       "      <td>Christopher Nolan</td>\n",
       "      <td>813.0</td>\n",
       "      <td>164.0</td>\n",
       "      <td>22000.0</td>\n",
       "      <td>23000.0</td>\n",
       "      <td>Christian Bale</td>\n",
       "      <td>27000.0</td>\n",
       "      <td>448130642.0</td>\n",
       "      <td>Action|Thriller</td>\n",
       "      <td>Tom Hardy</td>\n",
       "      <td>1144337</td>\n",
       "      <td>106759</td>\n",
       "      <td>Joseph Gordon-Levitt</td>\n",
       "      <td>0.0</td>\n",
       "      <td>deception|imprisonment|lawlessness|police offi...</td>\n",
       "      <td>http://www.imdb.com/title/tt1345836/?ref_=fn_t...</td>\n",
       "      <td>2701.0</td>\n",
       "      <td>English</td>\n",
       "      <td>USA</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>250000000.0</td>\n",
       "      <td>2012.0</td>\n",
       "      <td>23000.0</td>\n",
       "      <td>8.5</td>\n",
       "      <td>2.35</td>\n",
       "      <td>164000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>The Avengers</th>\n",
       "      <td>Color</td>\n",
       "      <td>Joss Whedon</td>\n",
       "      <td>703.0</td>\n",
       "      <td>173.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>19000.0</td>\n",
       "      <td>Robert Downey Jr.</td>\n",
       "      <td>26000.0</td>\n",
       "      <td>623279547.0</td>\n",
       "      <td>Action|Adventure|Sci-Fi</td>\n",
       "      <td>Chris Hemsworth</td>\n",
       "      <td>995415</td>\n",
       "      <td>87697</td>\n",
       "      <td>Scarlett Johansson</td>\n",
       "      <td>3.0</td>\n",
       "      <td>alien invasion|assassin|battle|iron man|soldier</td>\n",
       "      <td>http://www.imdb.com/title/tt0848228/?ref_=fn_t...</td>\n",
       "      <td>1722.0</td>\n",
       "      <td>English</td>\n",
       "      <td>USA</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>220000000.0</td>\n",
       "      <td>2012.0</td>\n",
       "      <td>21000.0</td>\n",
       "      <td>8.1</td>\n",
       "      <td>1.85</td>\n",
       "      <td>123000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Captain America: Civil War</th>\n",
       "      <td>Color</td>\n",
       "      <td>Anthony Russo</td>\n",
       "      <td>516.0</td>\n",
       "      <td>147.0</td>\n",
       "      <td>94.0</td>\n",
       "      <td>11000.0</td>\n",
       "      <td>Scarlett Johansson</td>\n",
       "      <td>21000.0</td>\n",
       "      <td>407197282.0</td>\n",
       "      <td>Action|Adventure|Sci-Fi</td>\n",
       "      <td>Robert Downey Jr.</td>\n",
       "      <td>272670</td>\n",
       "      <td>64798</td>\n",
       "      <td>Chris Evans</td>\n",
       "      <td>0.0</td>\n",
       "      <td>based on comic book|knife|marvel cinematic uni...</td>\n",
       "      <td>http://www.imdb.com/title/tt3498820/?ref_=fn_t...</td>\n",
       "      <td>1022.0</td>\n",
       "      <td>English</td>\n",
       "      <td>USA</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>250000000.0</td>\n",
       "      <td>2016.0</td>\n",
       "      <td>19000.0</td>\n",
       "      <td>8.2</td>\n",
       "      <td>2.35</td>\n",
       "      <td>72000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Guardians of the Galaxy</th>\n",
       "      <td>Color</td>\n",
       "      <td>James Gunn</td>\n",
       "      <td>653.0</td>\n",
       "      <td>121.0</td>\n",
       "      <td>571.0</td>\n",
       "      <td>3000.0</td>\n",
       "      <td>Vin Diesel</td>\n",
       "      <td>14000.0</td>\n",
       "      <td>333130696.0</td>\n",
       "      <td>Action|Adventure|Sci-Fi</td>\n",
       "      <td>Bradley Cooper</td>\n",
       "      <td>682155</td>\n",
       "      <td>32438</td>\n",
       "      <td>Djimon Hounsou</td>\n",
       "      <td>3.0</td>\n",
       "      <td>bounty hunter|outer space|raccoon|talking anim...</td>\n",
       "      <td>http://www.imdb.com/title/tt2015381/?ref_=fn_t...</td>\n",
       "      <td>1097.0</td>\n",
       "      <td>English</td>\n",
       "      <td>USA</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>170000000.0</td>\n",
       "      <td>2014.0</td>\n",
       "      <td>14000.0</td>\n",
       "      <td>8.1</td>\n",
       "      <td>2.35</td>\n",
       "      <td>96000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Interstellar</th>\n",
       "      <td>Color</td>\n",
       "      <td>Christopher Nolan</td>\n",
       "      <td>712.0</td>\n",
       "      <td>169.0</td>\n",
       "      <td>22000.0</td>\n",
       "      <td>6000.0</td>\n",
       "      <td>Anne Hathaway</td>\n",
       "      <td>11000.0</td>\n",
       "      <td>187991439.0</td>\n",
       "      <td>Adventure|Drama|Sci-Fi</td>\n",
       "      <td>Matthew McConaughey</td>\n",
       "      <td>928227</td>\n",
       "      <td>31488</td>\n",
       "      <td>Mackenzie Foy</td>\n",
       "      <td>1.0</td>\n",
       "      <td>black hole|father daughter relationship|saving...</td>\n",
       "      <td>http://www.imdb.com/title/tt0816692/?ref_=fn_t...</td>\n",
       "      <td>2725.0</td>\n",
       "      <td>English</td>\n",
       "      <td>USA</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>165000000.0</td>\n",
       "      <td>2014.0</td>\n",
       "      <td>11000.0</td>\n",
       "      <td>8.6</td>\n",
       "      <td>2.35</td>\n",
       "      <td>349000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                            color      director_name  num_critic_for_reviews  \\\n",
       "movie_title                                                                    \n",
       "The Dark Knight Rises       Color  Christopher Nolan                   813.0   \n",
       "The Avengers                Color        Joss Whedon                   703.0   \n",
       "Captain America: Civil War  Color      Anthony Russo                   516.0   \n",
       "Guardians of the Galaxy     Color         James Gunn                   653.0   \n",
       "Interstellar                Color  Christopher Nolan                   712.0   \n",
       "\n",
       "                            duration  director_facebook_likes  \\\n",
       "movie_title                                                     \n",
       "The Dark Knight Rises          164.0                  22000.0   \n",
       "The Avengers                   173.0                      0.0   \n",
       "Captain America: Civil War     147.0                     94.0   \n",
       "Guardians of the Galaxy        121.0                    571.0   \n",
       "Interstellar                   169.0                  22000.0   \n",
       "\n",
       "                            actor_3_facebook_likes        actor_2_name  \\\n",
       "movie_title                                                              \n",
       "The Dark Knight Rises                      23000.0      Christian Bale   \n",
       "The Avengers                               19000.0   Robert Downey Jr.   \n",
       "Captain America: Civil War                 11000.0  Scarlett Johansson   \n",
       "Guardians of the Galaxy                     3000.0          Vin Diesel   \n",
       "Interstellar                                6000.0       Anne Hathaway   \n",
       "\n",
       "                            actor_1_facebook_likes        gross  \\\n",
       "movie_title                                                       \n",
       "The Dark Knight Rises                      27000.0  448130642.0   \n",
       "The Avengers                               26000.0  623279547.0   \n",
       "Captain America: Civil War                 21000.0  407197282.0   \n",
       "Guardians of the Galaxy                    14000.0  333130696.0   \n",
       "Interstellar                               11000.0  187991439.0   \n",
       "\n",
       "                                             genres         actor_1_name  \\\n",
       "movie_title                                                                \n",
       "The Dark Knight Rises               Action|Thriller            Tom Hardy   \n",
       "The Avengers                Action|Adventure|Sci-Fi      Chris Hemsworth   \n",
       "Captain America: Civil War  Action|Adventure|Sci-Fi    Robert Downey Jr.   \n",
       "Guardians of the Galaxy     Action|Adventure|Sci-Fi       Bradley Cooper   \n",
       "Interstellar                 Adventure|Drama|Sci-Fi  Matthew McConaughey   \n",
       "\n",
       "                            num_voted_users  cast_total_facebook_likes  \\\n",
       "movie_title                                                              \n",
       "The Dark Knight Rises               1144337                     106759   \n",
       "The Avengers                         995415                      87697   \n",
       "Captain America: Civil War           272670                      64798   \n",
       "Guardians of the Galaxy              682155                      32438   \n",
       "Interstellar                         928227                      31488   \n",
       "\n",
       "                                    actor_3_name  facenumber_in_poster  \\\n",
       "movie_title                                                              \n",
       "The Dark Knight Rises       Joseph Gordon-Levitt                   0.0   \n",
       "The Avengers                  Scarlett Johansson                   3.0   \n",
       "Captain America: Civil War           Chris Evans                   0.0   \n",
       "Guardians of the Galaxy           Djimon Hounsou                   3.0   \n",
       "Interstellar                       Mackenzie Foy                   1.0   \n",
       "\n",
       "                                                                plot_keywords  \\\n",
       "movie_title                                                                     \n",
       "The Dark Knight Rises       deception|imprisonment|lawlessness|police offi...   \n",
       "The Avengers                  alien invasion|assassin|battle|iron man|soldier   \n",
       "Captain America: Civil War  based on comic book|knife|marvel cinematic uni...   \n",
       "Guardians of the Galaxy     bounty hunter|outer space|raccoon|talking anim...   \n",
       "Interstellar                black hole|father daughter relationship|saving...   \n",
       "\n",
       "                                                              movie_imdb_link  \\\n",
       "movie_title                                                                     \n",
       "The Dark Knight Rises       http://www.imdb.com/title/tt1345836/?ref_=fn_t...   \n",
       "The Avengers                http://www.imdb.com/title/tt0848228/?ref_=fn_t...   \n",
       "Captain America: Civil War  http://www.imdb.com/title/tt3498820/?ref_=fn_t...   \n",
       "Guardians of the Galaxy     http://www.imdb.com/title/tt2015381/?ref_=fn_t...   \n",
       "Interstellar                http://www.imdb.com/title/tt0816692/?ref_=fn_t...   \n",
       "\n",
       "                            num_user_for_reviews language country  \\\n",
       "movie_title                                                         \n",
       "The Dark Knight Rises                     2701.0  English     USA   \n",
       "The Avengers                              1722.0  English     USA   \n",
       "Captain America: Civil War                1022.0  English     USA   \n",
       "Guardians of the Galaxy                   1097.0  English     USA   \n",
       "Interstellar                              2725.0  English     USA   \n",
       "\n",
       "                           content_rating       budget  title_year  \\\n",
       "movie_title                                                          \n",
       "The Dark Knight Rises               PG-13  250000000.0      2012.0   \n",
       "The Avengers                        PG-13  220000000.0      2012.0   \n",
       "Captain America: Civil War          PG-13  250000000.0      2016.0   \n",
       "Guardians of the Galaxy             PG-13  170000000.0      2014.0   \n",
       "Interstellar                        PG-13  165000000.0      2014.0   \n",
       "\n",
       "                            actor_2_facebook_likes  imdb_score  aspect_ratio  \\\n",
       "movie_title                                                                    \n",
       "The Dark Knight Rises                      23000.0         8.5          2.35   \n",
       "The Avengers                               21000.0         8.1          1.85   \n",
       "Captain America: Civil War                 19000.0         8.2          2.35   \n",
       "Guardians of the Galaxy                    14000.0         8.1          2.35   \n",
       "Interstellar                               11000.0         8.6          2.35   \n",
       "\n",
       "                            movie_facebook_likes  \n",
       "movie_title                                       \n",
       "The Dark Knight Rises                     164000  \n",
       "The Avengers                              123000  \n",
       "Captain America: Civil War                 72000  \n",
       "Guardians of the Galaxy                    96000  \n",
       "Interstellar                              349000  "
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "movie[final_crit_all].head() # 索引值为True的行会被选取"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>imdb_score</th>\n",
       "      <th>content_rating</th>\n",
       "      <th>title_year</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>movie_title</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>The Dark Knight Rises</th>\n",
       "      <td>8.5</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>2012.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>The Avengers</th>\n",
       "      <td>8.1</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>2012.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Captain America: Civil War</th>\n",
       "      <td>8.2</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>2016.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Guardians of the Galaxy</th>\n",
       "      <td>8.1</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>2014.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Interstellar</th>\n",
       "      <td>8.6</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>2014.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Inception</th>\n",
       "      <td>8.8</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>2010.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>The Martian</th>\n",
       "      <td>8.1</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>2015.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Town &amp; Country</th>\n",
       "      <td>4.4</td>\n",
       "      <td>R</td>\n",
       "      <td>2001.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Sex and the City 2</th>\n",
       "      <td>4.3</td>\n",
       "      <td>R</td>\n",
       "      <td>2010.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Rollerball</th>\n",
       "      <td>3.0</td>\n",
       "      <td>R</td>\n",
       "      <td>2002.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                            imdb_score content_rating  title_year\n",
       "movie_title                                                      \n",
       "The Dark Knight Rises              8.5          PG-13      2012.0\n",
       "The Avengers                       8.1          PG-13      2012.0\n",
       "Captain America: Civil War         8.2          PG-13      2016.0\n",
       "Guardians of the Galaxy            8.1          PG-13      2014.0\n",
       "Interstellar                       8.6          PG-13      2014.0\n",
       "Inception                          8.8          PG-13      2010.0\n",
       "The Martian                        8.1          PG-13      2015.0\n",
       "Town & Country                     4.4              R      2001.0\n",
       "Sex and the City 2                 4.3              R      2010.0\n",
       "Rollerball                         3.0              R      2002.0"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cols = ['imdb_score', 'content_rating', 'title_year']\n",
    "movie_filtered = movie.loc[final_crit_all, cols] # final_crit_all，使用bool索引筛选行。\n",
    "movie_filtered.head(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "final_crit_a2 = (movie.imdb_score > 8) & \\\n",
    "                (movie.content_rating == 'PG-13') & \\\n",
    "                ((movie.title_year < 2000) | (movie.title_year > 2009))\n",
    "final_crit_a2.equals(final_crit_a) # 用equal做比较，每一列都相等返回True。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 使用布尔索引复制索引选择"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>INSTNM</th>\n",
       "      <th>CITY</th>\n",
       "      <th>STABBR</th>\n",
       "      <th>HBCU</th>\n",
       "      <th>MENONLY</th>\n",
       "      <th>WOMENONLY</th>\n",
       "      <th>RELAFFIL</th>\n",
       "      <th>SATVRMID</th>\n",
       "      <th>SATMTMID</th>\n",
       "      <th>DISTANCEONLY</th>\n",
       "      <th>UGDS</th>\n",
       "      <th>UGDS_WHITE</th>\n",
       "      <th>UGDS_BLACK</th>\n",
       "      <th>UGDS_HISP</th>\n",
       "      <th>UGDS_ASIAN</th>\n",
       "      <th>UGDS_AIAN</th>\n",
       "      <th>UGDS_NHPI</th>\n",
       "      <th>UGDS_2MOR</th>\n",
       "      <th>UGDS_NRA</th>\n",
       "      <th>UGDS_UNKN</th>\n",
       "      <th>PPTUG_EF</th>\n",
       "      <th>CURROPER</th>\n",
       "      <th>PCTPELL</th>\n",
       "      <th>PCTFLOAN</th>\n",
       "      <th>UG25ABV</th>\n",
       "      <th>MD_EARN_WNE_P10</th>\n",
       "      <th>GRAD_DEBT_MDN_SUPP</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>3610</th>\n",
       "      <td>Abilene Christian University</td>\n",
       "      <td>Abilene</td>\n",
       "      <td>TX</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>530.0</td>\n",
       "      <td>545.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3572.0</td>\n",
       "      <td>0.6739</td>\n",
       "      <td>0.0798</td>\n",
       "      <td>0.1414</td>\n",
       "      <td>0.0090</td>\n",
       "      <td>0.0039</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0454</td>\n",
       "      <td>0.0423</td>\n",
       "      <td>0.0045</td>\n",
       "      <td>0.0468</td>\n",
       "      <td>1</td>\n",
       "      <td>0.2595</td>\n",
       "      <td>0.5527</td>\n",
       "      <td>0.0381</td>\n",
       "      <td>40200</td>\n",
       "      <td>25985</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3611</th>\n",
       "      <td>Alvin Community College</td>\n",
       "      <td>Alvin</td>\n",
       "      <td>TX</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4682.0</td>\n",
       "      <td>0.5126</td>\n",
       "      <td>0.1034</td>\n",
       "      <td>0.3093</td>\n",
       "      <td>0.0500</td>\n",
       "      <td>0.0064</td>\n",
       "      <td>0.0038</td>\n",
       "      <td>0.0002</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0143</td>\n",
       "      <td>0.7123</td>\n",
       "      <td>1</td>\n",
       "      <td>0.1549</td>\n",
       "      <td>0.0625</td>\n",
       "      <td>0.2841</td>\n",
       "      <td>34500</td>\n",
       "      <td>6750</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3612</th>\n",
       "      <td>Amarillo College</td>\n",
       "      <td>Amarillo</td>\n",
       "      <td>TX</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9346.0</td>\n",
       "      <td>0.5104</td>\n",
       "      <td>0.0507</td>\n",
       "      <td>0.3888</td>\n",
       "      <td>0.0293</td>\n",
       "      <td>0.0122</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0001</td>\n",
       "      <td>0.0085</td>\n",
       "      <td>0.6922</td>\n",
       "      <td>1</td>\n",
       "      <td>0.3786</td>\n",
       "      <td>0.1573</td>\n",
       "      <td>0.3431</td>\n",
       "      <td>31700</td>\n",
       "      <td>10950</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3613</th>\n",
       "      <td>Angelina College</td>\n",
       "      <td>Lufkin</td>\n",
       "      <td>TX</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3825.0</td>\n",
       "      <td>0.5854</td>\n",
       "      <td>0.1508</td>\n",
       "      <td>0.2207</td>\n",
       "      <td>0.0076</td>\n",
       "      <td>0.0073</td>\n",
       "      <td>0.0013</td>\n",
       "      <td>0.0264</td>\n",
       "      <td>0.0005</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.5600</td>\n",
       "      <td>1</td>\n",
       "      <td>0.5308</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.2603</td>\n",
       "      <td>26900</td>\n",
       "      <td>PrivacySuppressed</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3614</th>\n",
       "      <td>Angelo State University</td>\n",
       "      <td>San Angelo</td>\n",
       "      <td>TX</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>475.0</td>\n",
       "      <td>490.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5290.0</td>\n",
       "      <td>0.5225</td>\n",
       "      <td>0.0841</td>\n",
       "      <td>0.3166</td>\n",
       "      <td>0.0087</td>\n",
       "      <td>0.0036</td>\n",
       "      <td>0.0017</td>\n",
       "      <td>0.0285</td>\n",
       "      <td>0.0331</td>\n",
       "      <td>0.0011</td>\n",
       "      <td>0.1289</td>\n",
       "      <td>1</td>\n",
       "      <td>0.4068</td>\n",
       "      <td>0.5279</td>\n",
       "      <td>0.1407</td>\n",
       "      <td>37700</td>\n",
       "      <td>21319.5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                            INSTNM        CITY STABBR  HBCU  MENONLY  \\\n",
       "3610  Abilene Christian University     Abilene     TX   0.0      0.0   \n",
       "3611       Alvin Community College       Alvin     TX   0.0      0.0   \n",
       "3612              Amarillo College    Amarillo     TX   0.0      0.0   \n",
       "3613              Angelina College      Lufkin     TX   0.0      0.0   \n",
       "3614       Angelo State University  San Angelo     TX   0.0      0.0   \n",
       "\n",
       "      WOMENONLY  RELAFFIL  SATVRMID  SATMTMID  DISTANCEONLY    UGDS  \\\n",
       "3610        0.0         1     530.0     545.0           0.0  3572.0   \n",
       "3611        0.0         0       NaN       NaN           0.0  4682.0   \n",
       "3612        0.0         0       NaN       NaN           0.0  9346.0   \n",
       "3613        0.0         0       NaN       NaN           0.0  3825.0   \n",
       "3614        0.0         0     475.0     490.0           0.0  5290.0   \n",
       "\n",
       "      UGDS_WHITE  UGDS_BLACK  UGDS_HISP  UGDS_ASIAN  UGDS_AIAN  UGDS_NHPI  \\\n",
       "3610      0.6739      0.0798     0.1414      0.0090     0.0039     0.0000   \n",
       "3611      0.5126      0.1034     0.3093      0.0500     0.0064     0.0038   \n",
       "3612      0.5104      0.0507     0.3888      0.0293     0.0122     0.0000   \n",
       "3613      0.5854      0.1508     0.2207      0.0076     0.0073     0.0013   \n",
       "3614      0.5225      0.0841     0.3166      0.0087     0.0036     0.0017   \n",
       "\n",
       "      UGDS_2MOR  UGDS_NRA  UGDS_UNKN  PPTUG_EF  CURROPER  PCTPELL  PCTFLOAN  \\\n",
       "3610     0.0454    0.0423     0.0045    0.0468         1   0.2595    0.5527   \n",
       "3611     0.0002    0.0000     0.0143    0.7123         1   0.1549    0.0625   \n",
       "3612     0.0000    0.0001     0.0085    0.6922         1   0.3786    0.1573   \n",
       "3613     0.0264    0.0005     0.0000    0.5600         1   0.5308    0.0000   \n",
       "3614     0.0285    0.0331     0.0011    0.1289         1   0.4068    0.5279   \n",
       "\n",
       "      UG25ABV MD_EARN_WNE_P10 GRAD_DEBT_MDN_SUPP  \n",
       "3610   0.0381           40200              25985  \n",
       "3611   0.2841           34500               6750  \n",
       "3612   0.3431           31700              10950  \n",
       "3613   0.2603           26900  PrivacySuppressed  \n",
       "3614   0.1407           37700            21319.5  "
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college = pd.read_csv('data/college.csv')\n",
    "college[college['STABBR'] == 'TX'].head() # 找到'STABBR'列等于'TX'的行，实际上college['STABBR'] == 'TX'返回了一个布尔索引。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>INSTNM</th>\n",
       "      <th>CITY</th>\n",
       "      <th>HBCU</th>\n",
       "      <th>MENONLY</th>\n",
       "      <th>WOMENONLY</th>\n",
       "      <th>RELAFFIL</th>\n",
       "      <th>SATVRMID</th>\n",
       "      <th>SATMTMID</th>\n",
       "      <th>DISTANCEONLY</th>\n",
       "      <th>UGDS</th>\n",
       "      <th>UGDS_WHITE</th>\n",
       "      <th>UGDS_BLACK</th>\n",
       "      <th>UGDS_HISP</th>\n",
       "      <th>UGDS_ASIAN</th>\n",
       "      <th>UGDS_AIAN</th>\n",
       "      <th>UGDS_NHPI</th>\n",
       "      <th>UGDS_2MOR</th>\n",
       "      <th>UGDS_NRA</th>\n",
       "      <th>UGDS_UNKN</th>\n",
       "      <th>PPTUG_EF</th>\n",
       "      <th>CURROPER</th>\n",
       "      <th>PCTPELL</th>\n",
       "      <th>PCTFLOAN</th>\n",
       "      <th>UG25ABV</th>\n",
       "      <th>MD_EARN_WNE_P10</th>\n",
       "      <th>GRAD_DEBT_MDN_SUPP</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>STABBR</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>TX</th>\n",
       "      <td>Abilene Christian University</td>\n",
       "      <td>Abilene</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>530.0</td>\n",
       "      <td>545.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3572.0</td>\n",
       "      <td>0.6739</td>\n",
       "      <td>0.0798</td>\n",
       "      <td>0.1414</td>\n",
       "      <td>0.0090</td>\n",
       "      <td>0.0039</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0454</td>\n",
       "      <td>0.0423</td>\n",
       "      <td>0.0045</td>\n",
       "      <td>0.0468</td>\n",
       "      <td>1</td>\n",
       "      <td>0.2595</td>\n",
       "      <td>0.5527</td>\n",
       "      <td>0.0381</td>\n",
       "      <td>40200</td>\n",
       "      <td>25985</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>TX</th>\n",
       "      <td>Alvin Community College</td>\n",
       "      <td>Alvin</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4682.0</td>\n",
       "      <td>0.5126</td>\n",
       "      <td>0.1034</td>\n",
       "      <td>0.3093</td>\n",
       "      <td>0.0500</td>\n",
       "      <td>0.0064</td>\n",
       "      <td>0.0038</td>\n",
       "      <td>0.0002</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0143</td>\n",
       "      <td>0.7123</td>\n",
       "      <td>1</td>\n",
       "      <td>0.1549</td>\n",
       "      <td>0.0625</td>\n",
       "      <td>0.2841</td>\n",
       "      <td>34500</td>\n",
       "      <td>6750</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>TX</th>\n",
       "      <td>Amarillo College</td>\n",
       "      <td>Amarillo</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9346.0</td>\n",
       "      <td>0.5104</td>\n",
       "      <td>0.0507</td>\n",
       "      <td>0.3888</td>\n",
       "      <td>0.0293</td>\n",
       "      <td>0.0122</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0001</td>\n",
       "      <td>0.0085</td>\n",
       "      <td>0.6922</td>\n",
       "      <td>1</td>\n",
       "      <td>0.3786</td>\n",
       "      <td>0.1573</td>\n",
       "      <td>0.3431</td>\n",
       "      <td>31700</td>\n",
       "      <td>10950</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>TX</th>\n",
       "      <td>Angelina College</td>\n",
       "      <td>Lufkin</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3825.0</td>\n",
       "      <td>0.5854</td>\n",
       "      <td>0.1508</td>\n",
       "      <td>0.2207</td>\n",
       "      <td>0.0076</td>\n",
       "      <td>0.0073</td>\n",
       "      <td>0.0013</td>\n",
       "      <td>0.0264</td>\n",
       "      <td>0.0005</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.5600</td>\n",
       "      <td>1</td>\n",
       "      <td>0.5308</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.2603</td>\n",
       "      <td>26900</td>\n",
       "      <td>PrivacySuppressed</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>TX</th>\n",
       "      <td>Angelo State University</td>\n",
       "      <td>San Angelo</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>475.0</td>\n",
       "      <td>490.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5290.0</td>\n",
       "      <td>0.5225</td>\n",
       "      <td>0.0841</td>\n",
       "      <td>0.3166</td>\n",
       "      <td>0.0087</td>\n",
       "      <td>0.0036</td>\n",
       "      <td>0.0017</td>\n",
       "      <td>0.0285</td>\n",
       "      <td>0.0331</td>\n",
       "      <td>0.0011</td>\n",
       "      <td>0.1289</td>\n",
       "      <td>1</td>\n",
       "      <td>0.4068</td>\n",
       "      <td>0.5279</td>\n",
       "      <td>0.1407</td>\n",
       "      <td>37700</td>\n",
       "      <td>21319.5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                              INSTNM        CITY  HBCU  MENONLY  WOMENONLY  \\\n",
       "STABBR                                                                       \n",
       "TX      Abilene Christian University     Abilene   0.0      0.0        0.0   \n",
       "TX           Alvin Community College       Alvin   0.0      0.0        0.0   \n",
       "TX                  Amarillo College    Amarillo   0.0      0.0        0.0   \n",
       "TX                  Angelina College      Lufkin   0.0      0.0        0.0   \n",
       "TX           Angelo State University  San Angelo   0.0      0.0        0.0   \n",
       "\n",
       "        RELAFFIL  SATVRMID  SATMTMID  DISTANCEONLY    UGDS  UGDS_WHITE  \\\n",
       "STABBR                                                                   \n",
       "TX             1     530.0     545.0           0.0  3572.0      0.6739   \n",
       "TX             0       NaN       NaN           0.0  4682.0      0.5126   \n",
       "TX             0       NaN       NaN           0.0  9346.0      0.5104   \n",
       "TX             0       NaN       NaN           0.0  3825.0      0.5854   \n",
       "TX             0     475.0     490.0           0.0  5290.0      0.5225   \n",
       "\n",
       "        UGDS_BLACK  UGDS_HISP  UGDS_ASIAN  UGDS_AIAN  UGDS_NHPI  UGDS_2MOR  \\\n",
       "STABBR                                                                       \n",
       "TX          0.0798     0.1414      0.0090     0.0039     0.0000     0.0454   \n",
       "TX          0.1034     0.3093      0.0500     0.0064     0.0038     0.0002   \n",
       "TX          0.0507     0.3888      0.0293     0.0122     0.0000     0.0000   \n",
       "TX          0.1508     0.2207      0.0076     0.0073     0.0013     0.0264   \n",
       "TX          0.0841     0.3166      0.0087     0.0036     0.0017     0.0285   \n",
       "\n",
       "        UGDS_NRA  UGDS_UNKN  PPTUG_EF  CURROPER  PCTPELL  PCTFLOAN  UG25ABV  \\\n",
       "STABBR                                                                        \n",
       "TX        0.0423     0.0045    0.0468         1   0.2595    0.5527   0.0381   \n",
       "TX        0.0000     0.0143    0.7123         1   0.1549    0.0625   0.2841   \n",
       "TX        0.0001     0.0085    0.6922         1   0.3786    0.1573   0.3431   \n",
       "TX        0.0005     0.0000    0.5600         1   0.5308    0.0000   0.2603   \n",
       "TX        0.0331     0.0011    0.1289         1   0.4068    0.5279   0.1407   \n",
       "\n",
       "       MD_EARN_WNE_P10 GRAD_DEBT_MDN_SUPP  \n",
       "STABBR                                     \n",
       "TX               40200              25985  \n",
       "TX               34500               6750  \n",
       "TX               31700              10950  \n",
       "TX               26900  PrivacySuppressed  \n",
       "TX               37700            21319.5  "
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college2 = college.set_index('STABBR')\n",
    "college2.loc['TX'].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "852 µs ± 11.4 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n"
     ]
    }
   ],
   "source": [
    "%timeit college[college['STABBR'] == 'TX'] # 使用布尔索引比loc慢"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "450 µs ± 5.8 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n"
     ]
    }
   ],
   "source": [
    "%timeit college2.loc['TX']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>INSTNM</th>\n",
       "      <th>CITY</th>\n",
       "      <th>HBCU</th>\n",
       "      <th>MENONLY</th>\n",
       "      <th>WOMENONLY</th>\n",
       "      <th>RELAFFIL</th>\n",
       "      <th>SATVRMID</th>\n",
       "      <th>SATMTMID</th>\n",
       "      <th>DISTANCEONLY</th>\n",
       "      <th>UGDS</th>\n",
       "      <th>UGDS_WHITE</th>\n",
       "      <th>UGDS_BLACK</th>\n",
       "      <th>UGDS_HISP</th>\n",
       "      <th>UGDS_ASIAN</th>\n",
       "      <th>UGDS_AIAN</th>\n",
       "      <th>UGDS_NHPI</th>\n",
       "      <th>UGDS_2MOR</th>\n",
       "      <th>UGDS_NRA</th>\n",
       "      <th>UGDS_UNKN</th>\n",
       "      <th>PPTUG_EF</th>\n",
       "      <th>CURROPER</th>\n",
       "      <th>PCTPELL</th>\n",
       "      <th>PCTFLOAN</th>\n",
       "      <th>UG25ABV</th>\n",
       "      <th>MD_EARN_WNE_P10</th>\n",
       "      <th>GRAD_DEBT_MDN_SUPP</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>STABBR</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>TX</th>\n",
       "      <td>Abilene Christian University</td>\n",
       "      <td>Abilene</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>530.0</td>\n",
       "      <td>545.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3572.0</td>\n",
       "      <td>0.6739</td>\n",
       "      <td>0.0798</td>\n",
       "      <td>0.1414</td>\n",
       "      <td>0.0090</td>\n",
       "      <td>0.0039</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0454</td>\n",
       "      <td>0.0423</td>\n",
       "      <td>0.0045</td>\n",
       "      <td>0.0468</td>\n",
       "      <td>1</td>\n",
       "      <td>0.2595</td>\n",
       "      <td>0.5527</td>\n",
       "      <td>0.0381</td>\n",
       "      <td>40200</td>\n",
       "      <td>25985</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>TX</th>\n",
       "      <td>Alvin Community College</td>\n",
       "      <td>Alvin</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4682.0</td>\n",
       "      <td>0.5126</td>\n",
       "      <td>0.1034</td>\n",
       "      <td>0.3093</td>\n",
       "      <td>0.0500</td>\n",
       "      <td>0.0064</td>\n",
       "      <td>0.0038</td>\n",
       "      <td>0.0002</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0143</td>\n",
       "      <td>0.7123</td>\n",
       "      <td>1</td>\n",
       "      <td>0.1549</td>\n",
       "      <td>0.0625</td>\n",
       "      <td>0.2841</td>\n",
       "      <td>34500</td>\n",
       "      <td>6750</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>TX</th>\n",
       "      <td>Amarillo College</td>\n",
       "      <td>Amarillo</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9346.0</td>\n",
       "      <td>0.5104</td>\n",
       "      <td>0.0507</td>\n",
       "      <td>0.3888</td>\n",
       "      <td>0.0293</td>\n",
       "      <td>0.0122</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0001</td>\n",
       "      <td>0.0085</td>\n",
       "      <td>0.6922</td>\n",
       "      <td>1</td>\n",
       "      <td>0.3786</td>\n",
       "      <td>0.1573</td>\n",
       "      <td>0.3431</td>\n",
       "      <td>31700</td>\n",
       "      <td>10950</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>TX</th>\n",
       "      <td>Angelina College</td>\n",
       "      <td>Lufkin</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3825.0</td>\n",
       "      <td>0.5854</td>\n",
       "      <td>0.1508</td>\n",
       "      <td>0.2207</td>\n",
       "      <td>0.0076</td>\n",
       "      <td>0.0073</td>\n",
       "      <td>0.0013</td>\n",
       "      <td>0.0264</td>\n",
       "      <td>0.0005</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.5600</td>\n",
       "      <td>1</td>\n",
       "      <td>0.5308</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.2603</td>\n",
       "      <td>26900</td>\n",
       "      <td>PrivacySuppressed</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>TX</th>\n",
       "      <td>Angelo State University</td>\n",
       "      <td>San Angelo</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>475.0</td>\n",
       "      <td>490.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5290.0</td>\n",
       "      <td>0.5225</td>\n",
       "      <td>0.0841</td>\n",
       "      <td>0.3166</td>\n",
       "      <td>0.0087</td>\n",
       "      <td>0.0036</td>\n",
       "      <td>0.0017</td>\n",
       "      <td>0.0285</td>\n",
       "      <td>0.0331</td>\n",
       "      <td>0.0011</td>\n",
       "      <td>0.1289</td>\n",
       "      <td>1</td>\n",
       "      <td>0.4068</td>\n",
       "      <td>0.5279</td>\n",
       "      <td>0.1407</td>\n",
       "      <td>37700</td>\n",
       "      <td>21319.5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                              INSTNM        CITY  HBCU  MENONLY  WOMENONLY  \\\n",
       "STABBR                                                                       \n",
       "TX      Abilene Christian University     Abilene   0.0      0.0        0.0   \n",
       "TX           Alvin Community College       Alvin   0.0      0.0        0.0   \n",
       "TX                  Amarillo College    Amarillo   0.0      0.0        0.0   \n",
       "TX                  Angelina College      Lufkin   0.0      0.0        0.0   \n",
       "TX           Angelo State University  San Angelo   0.0      0.0        0.0   \n",
       "\n",
       "        RELAFFIL  SATVRMID  SATMTMID  DISTANCEONLY    UGDS  UGDS_WHITE  \\\n",
       "STABBR                                                                   \n",
       "TX             1     530.0     545.0           0.0  3572.0      0.6739   \n",
       "TX             0       NaN       NaN           0.0  4682.0      0.5126   \n",
       "TX             0       NaN       NaN           0.0  9346.0      0.5104   \n",
       "TX             0       NaN       NaN           0.0  3825.0      0.5854   \n",
       "TX             0     475.0     490.0           0.0  5290.0      0.5225   \n",
       "\n",
       "        UGDS_BLACK  UGDS_HISP  UGDS_ASIAN  UGDS_AIAN  UGDS_NHPI  UGDS_2MOR  \\\n",
       "STABBR                                                                       \n",
       "TX          0.0798     0.1414      0.0090     0.0039     0.0000     0.0454   \n",
       "TX          0.1034     0.3093      0.0500     0.0064     0.0038     0.0002   \n",
       "TX          0.0507     0.3888      0.0293     0.0122     0.0000     0.0000   \n",
       "TX          0.1508     0.2207      0.0076     0.0073     0.0013     0.0264   \n",
       "TX          0.0841     0.3166      0.0087     0.0036     0.0017     0.0285   \n",
       "\n",
       "        UGDS_NRA  UGDS_UNKN  PPTUG_EF  CURROPER  PCTPELL  PCTFLOAN  UG25ABV  \\\n",
       "STABBR                                                                        \n",
       "TX        0.0423     0.0045    0.0468         1   0.2595    0.5527   0.0381   \n",
       "TX        0.0000     0.0143    0.7123         1   0.1549    0.0625   0.2841   \n",
       "TX        0.0001     0.0085    0.6922         1   0.3786    0.1573   0.3431   \n",
       "TX        0.0005     0.0000    0.5600         1   0.5308    0.0000   0.2603   \n",
       "TX        0.0331     0.0011    0.1289         1   0.4068    0.5279   0.1407   \n",
       "\n",
       "       MD_EARN_WNE_P10 GRAD_DEBT_MDN_SUPP  \n",
       "STABBR                                     \n",
       "TX               40200              25985  \n",
       "TX               34500               6750  \n",
       "TX               31700              10950  \n",
       "TX               26900  PrivacySuppressed  \n",
       "TX               37700            21319.5  "
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "states =['TX', 'CA', 'NY']\n",
    "college[college['STABBR'].isin(states)] # 'STABBR'列的取值是否在某个数组中\n",
    "college2.loc[states].head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 选取不重复的，排序的索引"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "college = pd.read_csv('data/college.csv')\n",
    "college2 = college.set_index('STABBR')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college2.index.is_monotonic # is_monotonic是否单调"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college3 = college2.sort_index()\n",
    "college3.index.is_monotonic"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "871 µs ± 24.6 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n"
     ]
    }
   ],
   "source": [
    "%timeit college[college['STABBR'] == 'TX']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "512 µs ± 41.2 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n"
     ]
    }
   ],
   "source": [
    "%timeit college2.loc['TX']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "202 µs ± 4.94 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n"
     ]
    }
   ],
   "source": [
    "%timeit college3.loc['TX'] # 排序后loc效率更高"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college_unique = college.set_index('INSTNM')\n",
    "college_unique.index.is_unique # 所有值没有重复，否则为False。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>INSTNM</th>\n",
       "      <th>CITY</th>\n",
       "      <th>STABBR</th>\n",
       "      <th>HBCU</th>\n",
       "      <th>MENONLY</th>\n",
       "      <th>WOMENONLY</th>\n",
       "      <th>RELAFFIL</th>\n",
       "      <th>SATVRMID</th>\n",
       "      <th>SATMTMID</th>\n",
       "      <th>DISTANCEONLY</th>\n",
       "      <th>UGDS</th>\n",
       "      <th>UGDS_WHITE</th>\n",
       "      <th>UGDS_BLACK</th>\n",
       "      <th>UGDS_HISP</th>\n",
       "      <th>UGDS_ASIAN</th>\n",
       "      <th>UGDS_AIAN</th>\n",
       "      <th>UGDS_NHPI</th>\n",
       "      <th>UGDS_2MOR</th>\n",
       "      <th>UGDS_NRA</th>\n",
       "      <th>UGDS_UNKN</th>\n",
       "      <th>PPTUG_EF</th>\n",
       "      <th>CURROPER</th>\n",
       "      <th>PCTPELL</th>\n",
       "      <th>PCTFLOAN</th>\n",
       "      <th>UG25ABV</th>\n",
       "      <th>MD_EARN_WNE_P10</th>\n",
       "      <th>GRAD_DEBT_MDN_SUPP</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>4217</th>\n",
       "      <td>Stanford University</td>\n",
       "      <td>Stanford</td>\n",
       "      <td>CA</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>730.0</td>\n",
       "      <td>745.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>7018.0</td>\n",
       "      <td>0.3752</td>\n",
       "      <td>0.0591</td>\n",
       "      <td>0.1607</td>\n",
       "      <td>0.1979</td>\n",
       "      <td>0.0114</td>\n",
       "      <td>0.0038</td>\n",
       "      <td>0.1067</td>\n",
       "      <td>0.0819</td>\n",
       "      <td>0.0031</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.1556</td>\n",
       "      <td>0.1256</td>\n",
       "      <td>0.0401</td>\n",
       "      <td>86000</td>\n",
       "      <td>12782</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   INSTNM      CITY STABBR  HBCU  MENONLY  WOMENONLY  \\\n",
       "4217  Stanford University  Stanford     CA   0.0      0.0        0.0   \n",
       "\n",
       "      RELAFFIL  SATVRMID  SATMTMID  DISTANCEONLY    UGDS  UGDS_WHITE  \\\n",
       "4217         0     730.0     745.0           0.0  7018.0      0.3752   \n",
       "\n",
       "      UGDS_BLACK  UGDS_HISP  UGDS_ASIAN  UGDS_AIAN  UGDS_NHPI  UGDS_2MOR  \\\n",
       "4217      0.0591     0.1607      0.1979     0.0114     0.0038     0.1067   \n",
       "\n",
       "      UGDS_NRA  UGDS_UNKN  PPTUG_EF  CURROPER  PCTPELL  PCTFLOAN  UG25ABV  \\\n",
       "4217    0.0819     0.0031       0.0         1   0.1556    0.1256   0.0401   \n",
       "\n",
       "     MD_EARN_WNE_P10 GRAD_DEBT_MDN_SUPP  \n",
       "4217           86000              12782  "
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college[college['INSTNM'] == 'Stanford University']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "CITY                  Stanford\n",
       "STABBR                      CA\n",
       "HBCU                         0\n",
       "MENONLY                      0\n",
       "WOMENONLY                    0\n",
       "RELAFFIL                     0\n",
       "SATVRMID                   730\n",
       "SATMTMID                   745\n",
       "DISTANCEONLY                 0\n",
       "UGDS                      7018\n",
       "UGDS_WHITE              0.3752\n",
       "UGDS_BLACK              0.0591\n",
       "UGDS_HISP               0.1607\n",
       "UGDS_ASIAN              0.1979\n",
       "UGDS_AIAN               0.0114\n",
       "UGDS_NHPI               0.0038\n",
       "UGDS_2MOR               0.1067\n",
       "UGDS_NRA                0.0819\n",
       "UGDS_UNKN               0.0031\n",
       "PPTUG_EF                     0\n",
       "CURROPER                     1\n",
       "PCTPELL                 0.1556\n",
       "PCTFLOAN                0.1256\n",
       "UG25ABV                 0.0401\n",
       "MD_EARN_WNE_P10          86000\n",
       "GRAD_DEBT_MDN_SUPP       12782\n",
       "Name: Stanford University, dtype: object"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college_unique.loc['Stanford University']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "946 µs ± 26.4 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n"
     ]
    }
   ],
   "source": [
    "%timeit college[college['INSTNM'] == 'Stanford University']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "152 µs ± 2.3 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)\n"
     ]
    }
   ],
   "source": [
    "%timeit college_unique.loc['Stanford University'] # 排序后性能优势明显"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>INSTNM</th>\n",
       "      <th>CITY</th>\n",
       "      <th>STABBR</th>\n",
       "      <th>HBCU</th>\n",
       "      <th>MENONLY</th>\n",
       "      <th>WOMENONLY</th>\n",
       "      <th>RELAFFIL</th>\n",
       "      <th>SATVRMID</th>\n",
       "      <th>SATMTMID</th>\n",
       "      <th>DISTANCEONLY</th>\n",
       "      <th>UGDS</th>\n",
       "      <th>UGDS_WHITE</th>\n",
       "      <th>UGDS_BLACK</th>\n",
       "      <th>UGDS_HISP</th>\n",
       "      <th>UGDS_ASIAN</th>\n",
       "      <th>UGDS_AIAN</th>\n",
       "      <th>UGDS_NHPI</th>\n",
       "      <th>UGDS_2MOR</th>\n",
       "      <th>UGDS_NRA</th>\n",
       "      <th>UGDS_UNKN</th>\n",
       "      <th>PPTUG_EF</th>\n",
       "      <th>CURROPER</th>\n",
       "      <th>PCTPELL</th>\n",
       "      <th>PCTFLOAN</th>\n",
       "      <th>UG25ABV</th>\n",
       "      <th>MD_EARN_WNE_P10</th>\n",
       "      <th>GRAD_DEBT_MDN_SUPP</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>ARTESIA, CA</th>\n",
       "      <td>Angeles Institute</td>\n",
       "      <td>ARTESIA</td>\n",
       "      <td>CA</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>114.0</td>\n",
       "      <td>0.0175</td>\n",
       "      <td>0.2193</td>\n",
       "      <td>0.3860</td>\n",
       "      <td>0.3158</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0263</td>\n",
       "      <td>0.0175</td>\n",
       "      <td>0.0088</td>\n",
       "      <td>0.0088</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>1</td>\n",
       "      <td>0.6275</td>\n",
       "      <td>0.8138</td>\n",
       "      <td>0.5429</td>\n",
       "      <td>NaN</td>\n",
       "      <td>16850</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Aberdeen, SD</th>\n",
       "      <td>Presentation College</td>\n",
       "      <td>Aberdeen</td>\n",
       "      <td>SD</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>440.0</td>\n",
       "      <td>480.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>705.0</td>\n",
       "      <td>0.6525</td>\n",
       "      <td>0.1163</td>\n",
       "      <td>0.0780</td>\n",
       "      <td>0.0128</td>\n",
       "      <td>0.0156</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0284</td>\n",
       "      <td>0.0142</td>\n",
       "      <td>0.0823</td>\n",
       "      <td>0.2865</td>\n",
       "      <td>1</td>\n",
       "      <td>0.4829</td>\n",
       "      <td>0.7560</td>\n",
       "      <td>0.3097</td>\n",
       "      <td>35900</td>\n",
       "      <td>25000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Aberdeen, SD</th>\n",
       "      <td>Northern State University</td>\n",
       "      <td>Aberdeen</td>\n",
       "      <td>SD</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>480.0</td>\n",
       "      <td>475.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1693.0</td>\n",
       "      <td>0.8435</td>\n",
       "      <td>0.0230</td>\n",
       "      <td>0.0319</td>\n",
       "      <td>0.0112</td>\n",
       "      <td>0.0207</td>\n",
       "      <td>0.0030</td>\n",
       "      <td>0.0219</td>\n",
       "      <td>0.0425</td>\n",
       "      <td>0.0024</td>\n",
       "      <td>0.1872</td>\n",
       "      <td>1</td>\n",
       "      <td>0.2272</td>\n",
       "      <td>0.4303</td>\n",
       "      <td>0.1766</td>\n",
       "      <td>33600</td>\n",
       "      <td>24847</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Aberdeen, WA</th>\n",
       "      <td>Grays Harbor College</td>\n",
       "      <td>Aberdeen</td>\n",
       "      <td>WA</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1121.0</td>\n",
       "      <td>0.7110</td>\n",
       "      <td>0.0169</td>\n",
       "      <td>0.0946</td>\n",
       "      <td>0.0214</td>\n",
       "      <td>0.0312</td>\n",
       "      <td>0.0054</td>\n",
       "      <td>0.0937</td>\n",
       "      <td>0.0009</td>\n",
       "      <td>0.0250</td>\n",
       "      <td>0.1820</td>\n",
       "      <td>1</td>\n",
       "      <td>0.4530</td>\n",
       "      <td>0.1502</td>\n",
       "      <td>0.5087</td>\n",
       "      <td>27000</td>\n",
       "      <td>11490</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Abilene, TX</th>\n",
       "      <td>Hardin-Simmons University</td>\n",
       "      <td>Abilene</td>\n",
       "      <td>TX</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>508.0</td>\n",
       "      <td>515.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1576.0</td>\n",
       "      <td>0.7126</td>\n",
       "      <td>0.0742</td>\n",
       "      <td>0.1472</td>\n",
       "      <td>0.0076</td>\n",
       "      <td>0.0019</td>\n",
       "      <td>0.0006</td>\n",
       "      <td>0.0298</td>\n",
       "      <td>0.0159</td>\n",
       "      <td>0.0102</td>\n",
       "      <td>0.0685</td>\n",
       "      <td>1</td>\n",
       "      <td>0.3256</td>\n",
       "      <td>0.5547</td>\n",
       "      <td>0.0982</td>\n",
       "      <td>38700</td>\n",
       "      <td>25864</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                 INSTNM      CITY STABBR  HBCU  MENONLY  \\\n",
       "ARTESIA, CA           Angeles Institute   ARTESIA     CA   0.0      0.0   \n",
       "Aberdeen, SD       Presentation College  Aberdeen     SD   0.0      0.0   \n",
       "Aberdeen, SD  Northern State University  Aberdeen     SD   0.0      0.0   \n",
       "Aberdeen, WA       Grays Harbor College  Aberdeen     WA   0.0      0.0   \n",
       "Abilene, TX   Hardin-Simmons University   Abilene     TX   0.0      0.0   \n",
       "\n",
       "              WOMENONLY  RELAFFIL  SATVRMID  SATMTMID  DISTANCEONLY    UGDS  \\\n",
       "ARTESIA, CA         0.0         0       NaN       NaN           0.0   114.0   \n",
       "Aberdeen, SD        0.0         1     440.0     480.0           0.0   705.0   \n",
       "Aberdeen, SD        0.0         0     480.0     475.0           0.0  1693.0   \n",
       "Aberdeen, WA        0.0         0       NaN       NaN           0.0  1121.0   \n",
       "Abilene, TX         0.0         1     508.0     515.0           0.0  1576.0   \n",
       "\n",
       "              UGDS_WHITE  UGDS_BLACK  UGDS_HISP  UGDS_ASIAN  UGDS_AIAN  \\\n",
       "ARTESIA, CA       0.0175      0.2193     0.3860      0.3158     0.0000   \n",
       "Aberdeen, SD      0.6525      0.1163     0.0780      0.0128     0.0156   \n",
       "Aberdeen, SD      0.8435      0.0230     0.0319      0.0112     0.0207   \n",
       "Aberdeen, WA      0.7110      0.0169     0.0946      0.0214     0.0312   \n",
       "Abilene, TX       0.7126      0.0742     0.1472      0.0076     0.0019   \n",
       "\n",
       "              UGDS_NHPI  UGDS_2MOR  UGDS_NRA  UGDS_UNKN  PPTUG_EF  CURROPER  \\\n",
       "ARTESIA, CA      0.0263     0.0175    0.0088     0.0088    0.0000         1   \n",
       "Aberdeen, SD     0.0000     0.0284    0.0142     0.0823    0.2865         1   \n",
       "Aberdeen, SD     0.0030     0.0219    0.0425     0.0024    0.1872         1   \n",
       "Aberdeen, WA     0.0054     0.0937    0.0009     0.0250    0.1820         1   \n",
       "Abilene, TX      0.0006     0.0298    0.0159     0.0102    0.0685         1   \n",
       "\n",
       "              PCTPELL  PCTFLOAN  UG25ABV MD_EARN_WNE_P10 GRAD_DEBT_MDN_SUPP  \n",
       "ARTESIA, CA    0.6275    0.8138   0.5429             NaN              16850  \n",
       "Aberdeen, SD   0.4829    0.7560   0.3097           35900              25000  \n",
       "Aberdeen, SD   0.2272    0.4303   0.1766           33600              24847  \n",
       "Aberdeen, WA   0.4530    0.1502   0.5087           27000              11490  \n",
       "Abilene, TX    0.3256    0.5547   0.0982           38700              25864  "
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 重建索引并排序\n",
    "college.index = college['CITY'] + ', ' + college['STABBR']\n",
    "college = college.sort_index()\n",
    "college.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>INSTNM</th>\n",
       "      <th>CITY</th>\n",
       "      <th>STABBR</th>\n",
       "      <th>HBCU</th>\n",
       "      <th>MENONLY</th>\n",
       "      <th>WOMENONLY</th>\n",
       "      <th>RELAFFIL</th>\n",
       "      <th>SATVRMID</th>\n",
       "      <th>SATMTMID</th>\n",
       "      <th>DISTANCEONLY</th>\n",
       "      <th>UGDS</th>\n",
       "      <th>UGDS_WHITE</th>\n",
       "      <th>UGDS_BLACK</th>\n",
       "      <th>UGDS_HISP</th>\n",
       "      <th>UGDS_ASIAN</th>\n",
       "      <th>UGDS_AIAN</th>\n",
       "      <th>UGDS_NHPI</th>\n",
       "      <th>UGDS_2MOR</th>\n",
       "      <th>UGDS_NRA</th>\n",
       "      <th>UGDS_UNKN</th>\n",
       "      <th>PPTUG_EF</th>\n",
       "      <th>CURROPER</th>\n",
       "      <th>PCTPELL</th>\n",
       "      <th>PCTFLOAN</th>\n",
       "      <th>UG25ABV</th>\n",
       "      <th>MD_EARN_WNE_P10</th>\n",
       "      <th>GRAD_DEBT_MDN_SUPP</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Miami, FL</th>\n",
       "      <td>New Professions Technical Institute</td>\n",
       "      <td>Miami</td>\n",
       "      <td>FL</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>0.0179</td>\n",
       "      <td>0.0714</td>\n",
       "      <td>0.9107</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.4464</td>\n",
       "      <td>1</td>\n",
       "      <td>0.8701</td>\n",
       "      <td>0.6780</td>\n",
       "      <td>0.8358</td>\n",
       "      <td>18700</td>\n",
       "      <td>8682</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Miami, FL</th>\n",
       "      <td>Management Resources College</td>\n",
       "      <td>Miami</td>\n",
       "      <td>FL</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>708.0</td>\n",
       "      <td>0.0071</td>\n",
       "      <td>0.0523</td>\n",
       "      <td>0.9407</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>1</td>\n",
       "      <td>0.4239</td>\n",
       "      <td>0.5458</td>\n",
       "      <td>0.8698</td>\n",
       "      <td>PrivacySuppressed</td>\n",
       "      <td>12182</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Miami, FL</th>\n",
       "      <td>Strayer University-Doral</td>\n",
       "      <td>Miami</td>\n",
       "      <td>FL</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>49200</td>\n",
       "      <td>36173.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Miami, FL</th>\n",
       "      <td>Keiser University- Miami</td>\n",
       "      <td>Miami</td>\n",
       "      <td>FL</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>29700</td>\n",
       "      <td>26063</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Miami, FL</th>\n",
       "      <td>George T Baker Aviation Technical College</td>\n",
       "      <td>Miami</td>\n",
       "      <td>FL</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>649.0</td>\n",
       "      <td>0.0894</td>\n",
       "      <td>0.1263</td>\n",
       "      <td>0.7735</td>\n",
       "      <td>0.0046</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0015</td>\n",
       "      <td>0.0046</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.5686</td>\n",
       "      <td>1</td>\n",
       "      <td>0.2567</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.4366</td>\n",
       "      <td>38600</td>\n",
       "      <td>PrivacySuppressed</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                              INSTNM   CITY STABBR  HBCU  \\\n",
       "Miami, FL        New Professions Technical Institute  Miami     FL   0.0   \n",
       "Miami, FL               Management Resources College  Miami     FL   0.0   \n",
       "Miami, FL                   Strayer University-Doral  Miami     FL   NaN   \n",
       "Miami, FL                   Keiser University- Miami  Miami     FL   NaN   \n",
       "Miami, FL  George T Baker Aviation Technical College  Miami     FL   0.0   \n",
       "\n",
       "           MENONLY  WOMENONLY  RELAFFIL  SATVRMID  SATMTMID  DISTANCEONLY  \\\n",
       "Miami, FL      0.0        0.0         0       NaN       NaN           0.0   \n",
       "Miami, FL      0.0        0.0         0       NaN       NaN           0.0   \n",
       "Miami, FL      NaN        NaN         1       NaN       NaN           NaN   \n",
       "Miami, FL      NaN        NaN         1       NaN       NaN           NaN   \n",
       "Miami, FL      0.0        0.0         0       NaN       NaN           0.0   \n",
       "\n",
       "            UGDS  UGDS_WHITE  UGDS_BLACK  UGDS_HISP  UGDS_ASIAN  UGDS_AIAN  \\\n",
       "Miami, FL   56.0      0.0179      0.0714     0.9107      0.0000        0.0   \n",
       "Miami, FL  708.0      0.0071      0.0523     0.9407      0.0000        0.0   \n",
       "Miami, FL    NaN         NaN         NaN        NaN         NaN        NaN   \n",
       "Miami, FL    NaN         NaN         NaN        NaN         NaN        NaN   \n",
       "Miami, FL  649.0      0.0894      0.1263     0.7735      0.0046        0.0   \n",
       "\n",
       "           UGDS_NHPI  UGDS_2MOR  UGDS_NRA  UGDS_UNKN  PPTUG_EF  CURROPER  \\\n",
       "Miami, FL     0.0000     0.0000       0.0        0.0    0.4464         1   \n",
       "Miami, FL     0.0000     0.0000       0.0        0.0    0.0000         1   \n",
       "Miami, FL        NaN        NaN       NaN        NaN       NaN         1   \n",
       "Miami, FL        NaN        NaN       NaN        NaN       NaN         1   \n",
       "Miami, FL     0.0015     0.0046       0.0        0.0    0.5686         1   \n",
       "\n",
       "           PCTPELL  PCTFLOAN  UG25ABV    MD_EARN_WNE_P10 GRAD_DEBT_MDN_SUPP  \n",
       "Miami, FL   0.8701    0.6780   0.8358              18700               8682  \n",
       "Miami, FL   0.4239    0.5458   0.8698  PrivacySuppressed              12182  \n",
       "Miami, FL      NaN       NaN      NaN              49200            36173.5  \n",
       "Miami, FL      NaN       NaN      NaN              29700              26063  \n",
       "Miami, FL   0.2567    0.0000   0.4366              38600  PrivacySuppressed  "
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "college.loc['Miami, FL'].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1.57 ms ± 92.3 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n"
     ]
    }
   ],
   "source": [
    "%%timeit \n",
    "crit1 = college['CITY'] == 'Miami' \n",
    "crit2 = college['STABBR'] == 'FL'\n",
    "college[crit1 & crit2]\n",
    "# %%timeit后面跟多行代码，而且在notebook里一定要写在第一行..."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "210 µs ± 11.4 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n"
     ]
    }
   ],
   "source": [
    "%timeit college.loc['Miami, FL']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c = college[(college['CITY'] == 'Miami') & (college['STABBR'] == 'FL')] # 先根据'CITY'找符合要求的行，然后根据'STABBR'再过滤。\n",
    "c.equals(college.loc['Miami, FL'])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 股价分析"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Open</th>\n",
       "      <th>High</th>\n",
       "      <th>Low</th>\n",
       "      <th>Close</th>\n",
       "      <th>Volume</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2010-01-04</th>\n",
       "      <td>66.39</td>\n",
       "      <td>67.20</td>\n",
       "      <td>66.12</td>\n",
       "      <td>67.11</td>\n",
       "      <td>5771234</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-05</th>\n",
       "      <td>66.99</td>\n",
       "      <td>67.62</td>\n",
       "      <td>66.73</td>\n",
       "      <td>67.30</td>\n",
       "      <td>7366270</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-06</th>\n",
       "      <td>67.17</td>\n",
       "      <td>68.94</td>\n",
       "      <td>67.03</td>\n",
       "      <td>68.80</td>\n",
       "      <td>9949946</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-07</th>\n",
       "      <td>68.49</td>\n",
       "      <td>69.81</td>\n",
       "      <td>68.21</td>\n",
       "      <td>69.51</td>\n",
       "      <td>7700297</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-08</th>\n",
       "      <td>69.19</td>\n",
       "      <td>72.00</td>\n",
       "      <td>69.09</td>\n",
       "      <td>70.65</td>\n",
       "      <td>13487621</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             Open   High    Low  Close    Volume\n",
       "Date                                            \n",
       "2010-01-04  66.39  67.20  66.12  67.11   5771234\n",
       "2010-01-05  66.99  67.62  66.73  67.30   7366270\n",
       "2010-01-06  67.17  68.94  67.03  68.80   9949946\n",
       "2010-01-07  68.49  69.81  68.21  69.51   7700297\n",
       "2010-01-08  69.19  72.00  69.09  70.65  13487621"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "slb = pd.read_csv('data/slb_stock.csv', index_col='Date', parse_dates=['Date'])\n",
    "slb.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "count    1895.000000\n",
       "mean       79.121905\n",
       "std        11.767802\n",
       "min        51.750000\n",
       "10%        64.892000\n",
       "50%        78.000000\n",
       "90%        93.248000\n",
       "max       117.950000\n",
       "Name: Close, dtype: float64"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "slb_close = slb['Close']\n",
    "slb_summary = slb_close.describe(percentiles=[.1, .9]) # 统计收盘价数据\n",
    "slb_summary"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [],
   "source": [
    "upper_10 = slb_summary.loc['90%']\n",
    "lower_10 = slb_summary.loc['10%']\n",
    "criteria = (slb_close < lower_10) | (slb_close > upper_10) # 找到最低10%和最高10%的收盘价\n",
    "slb_top_bottom_10 = slb_close[criteria]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.LineCollection at 0xf5f66e8>"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAsYAAAFeCAYAAACGtdkGAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zL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ddherqaqxYsQKAPwOsz1YCoVfXay8yMzNjzhirvtCRljfEcoxSf68bb7wRr7zyStSPQ9TeMDCmuKupqUFBQUHIDIeaEOfxeAyBsTlj3NjYiKFDh+LNN98E0PJSig8++AC5ubk47bTTtG0q68WMMaUTfWDct2/fFgep1157reHyqlWr4HK54HK50LFjR0ycaJwW0qlTJ9x///2GbS09ld/WxOOYoQLdlgbGn3/+eYufSz9/o7lSESLaj4ExxdWWLVvwzDPPoGvXriFvEypjrAJjlc1taGjAgQceiHHjxgFo+fKmixcvxtFHH631Rgb2B9e5ubmsvaO0oe8ooX89R+qRRx4xXK6trdXqiTt27Bj0JTY3NxennnqqYVt7D4wzMzOxdu1aPP300wD8pSldu3bFRx99BKfTGdFCGtEExkOHDsWECRNaPN507ilN8fHee+/hlltuSfYw0g4DY4qr3//+9wAQth1RpBnjhoYG5OTkIDs7G8D+05CR2r17N3r16mWoY1ZLpPbv3x8bN25s0eMRJYOU0tACMdyXznBuu+027efS0lJt4qs50B4yZAiys7PRo0cPw/b2HhhnZWXhvffew+WXX47q6mqsWrUKu3btwsknn4yioiLD/jWrq6uDx+OJKjBu7/udonf66adj5syZXP2whRgYU1y89957WLdunWHZ5VBUYPzJJ58YWhap++gzxjk5OVr5g1Uf1nDq6uqQl5dnOCio1fR69OgRVZcLotbU1NQEm82GL774Qtum2nC11NChQ7Wf9WUSZ555JoD9K9i9+OKLEEJACKFNxgMYGOtLE9asWRNUzrJhw4aQ9+3QoQOmTZumHR8bGhoiKstgYEzx4HQ6kz2EtBJTH2MiwF/icPrppwPY37ZJLftsJSMjA0IIfPXVV0HbAf8HsHoj5+TkaB9ALc0Y19XVIT8/35BtO/TQQwH4g3PzTH+iVPPzzz9r9cUPPvggunbtivHjxwNAiyfgjRkzxnK7OiPTrVs31NbWapcBf4u2u+66CwADY30f4T179hgC5aysrJB13+o48/LLLxuW7967d2+z2f94BsYejyfiRUKobTEvukXhMWNMMdMHrGolrXCBMWDMvmRnZxsmF+k/gHJyciCE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zo21ojY6yccsopmDJlCqZMmWLYnpmZiQcffFA7JRXujc5SivalvLwc3bt3T4nZ9h6PJ+gDKhRmjFOTVca4sLDQcBt93+JwnUXMfapHjx6Nq6++Og6jbN4nn3yCadOmYerUqTjwwAMBIC4Z4++++w633HJLXMaYyv71r38hKysL+/btg9PpNFz3xBNPAECzx5wvv/wyaJvVl5Krr74aF154IVasWBFVxhjwJ7X0tm7dqj0WA+P9GBhTWKEyxgBw3nnnadvC1US1puuuuw4TJ04EwMCY9nvppZewY8eOlDhd6PV6MXTo0Ihuy4xxarKqMe7Roweuv/565OXlYejQodi9e7d2XbgzaipjrPz2t79ttU4khxxyCObMmWMItFRgHEvGeOzYsZg5c2abL8d4+eWXAfiXWja3ZlNffu+4446wn4+q45Oeed9XVVWhuroaALBo0aKoW/n17t3bcFkfGKfKZ3gqYGBMYYULjPX1aWvXrm21MTVHZa/DBb08fdS+qFOPyf6gllLC5/MhMzMzouCnuLi4FUZFLWVVSgH4+xLX19dj9erVhu3hyizGjh1ruJzsY1I8SykaGhpifox4qaurgxACTz75ZNwec/DgwQCAX375BZs2bTJcd+ihhwIA3nrrrbDPqRb00M/bMR+nhg8fjq+++kq7rG8F2BLmWvfq6mo88MADAJL/ukslDIwprJkzZwZtM58yBFIrMFYN+MMtx7lnzx4AwCuvvNIqY6LkUoFMsrMi6staZmYmKisrsX37dpx11llBtzv55JMBtE7tPrWcVSkF4C+LsMrmhQuMHQ6HIfN87bXXxmmU0YlHKYXKQpoXhkomFUyG6qykV11djWHDhjXbVULNa/n5558NweozzzyDjIwMjBs3DoCxNaNZ9+7dcfjhh+M///mPts38pUT1Hj7mmGOaHXs4Bx98MO699178+uuv2jiVmTNnsjNFQEyBsRDiL0KIlUKIUiHEXCFEthCiWAjxrRBinRDidSGEvflHolS3evVq/PGPf8QxxxxjOWNa9e5MBWo1PDWxxIpaY55LZLYPqZIxVoG5zWZD586dUVBQgIsuuijodh988AEzOCksXGCsN2TIEBx00EEhl19W9K/LcBP1Wo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C5IGIiMJixpiIKLXkCCGWw1824YF/st1DgeueBPCmEOJ3AD4GsC+wfQUArxDiZwDPA3gU/k4VPwohBIDtAM5oneETEaUvTr4jIiIiIgJLKYiIiIiIADAwJiIiIiICwMCYiIiIiAgAA2MiIiIiIgAMjImIiIiIADAwJiIiIiICwMCYiIiIiAgAA2MiIiIiIgDA/wOkHURmXIFSugAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 864x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "slb_close.plot(color='black', figsize=(12,6))\n",
    "'''\n",
    "marker: 点标记\n",
    "style=' ': 不用连线\n",
    "ms=4: 点的大小\n",
    "'''\n",
    "slb_top_bottom_10.plot(marker='o', style=' ', ms=4, color='lightgray')\n",
    "\n",
    "xmin = criteria.index[0]\n",
    "xmax = criteria.index[-1]\n",
    "plt.hlines(y=[lower_10, upper_10], xmin=xmin, xmax=xmax,color='red') # 标记线"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PolyCollection at 0xec0238>"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAsYAAAFeCAYAAACGtdkGAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAACDeklEQVR4nO3dd5xjVd348c9Jmdlp2zvssrAssDTBXdpDlaUKUpQOigryiCgqFlB/FB/xER9U7AhKEwEpKk2qu5RlqQvsAtvY3tv0kp6c3x/nJrlJbmYyk2RS5vt+vfaVm5ub5Oyd5OZ7z/2e71Faa4QQQgghhBjqXKVugBBCCCGEEOVAAmMhhBBCCCGQwFgIIYQQQghAAm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f2X2HIfsyP7L/8yT7Mn+zD/Mk+rBzlmkoBJBLVNTABeNJa3QX8EFP/cK02Nf9kSsksZB/mR/ZfYch+zI/sv/zJPsyf7MP8yT4sf2XZY2wTA7yYedYPtM6mrgdiWuvX4h8e0SvZh/mR/VcYsh/zI/svf7IP8yf7MH+yD8tc2ZZri1NmHvXXrX/3aK3vKnGTKo7sw/zI/isM2Y/5kf2XP9mH+ZN9mD/Zh+WtEgLjXYHPA7/SpsC66CfZh/mR/VcYsh/zI/svf7IP8yf7MH+yD8tb2QfGQgghhBBCDIZyzzEWQgghhBBiUEhgLIQQQgghBBIYCyGEEEIIAUhgLIQQQgghBCCBsRBClBWlVFQptUgptUQptVgp9R2lVK/HaqXUNKXURYPVRiGEqFYSGAshRHnxa60P0lrvh5k29lTgxj6eMw2QwFgIIfIk5dqEEKKMKKW6tdaNtvt7AO8AY4HdgPuBBuvhr2utX1dKvQnMBNYC9wG/BW4BjgNqgT9ore8YtP+EEEJUKAmMhRCijKQHxta6dmBvoAszdWxAKTUDeEhrPVspdRzwXa316db2VwDjtdY3K6VqgQXAuVrrtYP4XxFCiIrjKXUDhBBC5MwL/F4pdRAQBfbKst1JwIFKqXOs+yOAGZgeZSGEEFlIYCyEEGXMSqWIAjswucbbgU9gxogEsj0N+IbW+vlBaaQQQlQJGXwnhBBlSik1DvgT8Htt8t5GAFu11jHg84Db2rQLaLI99XngSqWU13qdvZRSDQghhOiV9BgLIUR5qVNKLcKkTUQwg+1+ZT32R+AfSqkvAM8BPdb6D4CoUmoxcC/wG0yliveUUgrYCZw1OM0XQojKJYPvhBBCCCGEQFIphBBCCCGEACQwFkIIIYQQApDAWAghhBBCCEACYyGEEEIIIQAJjIUQQgghhAAkMBZCCCGEEAKQwFgIIYQQQghAAmMhhBBCCCEA+P/lbmopBRV0hAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 864x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "slb_close.plot(color='black', figsize=(12,6)) # 收盘价\n",
    "plt.hlines(y=[lower_10, upper_10], # 10%,90%位置画条参考线\n",
    "           xmin=xmin, xmax=xmax,color='red')\n",
    "plt.fill_between(x=criteria.index, y1=lower_10,\n",
    "                 y2=slb_close.values, color='green') # 范围中的填充绿色\n",
    "plt.fill_between(x=criteria.index,y1=lower_10,\n",
    "                 y2=slb_close.values, where=slb_close < lower_10,\n",
    "                 color='blue') # 低于10%的填充蓝色\n",
    "plt.fill_between(x=criteria.index, y1=upper_10, \n",
    "                 y2=slb_close.values, where=slb_close > upper_10,\n",
    "                 color='lightgray')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 实现SQL的where语句"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [],
   "source": [
    "employee = pd.read_csv('data/employee.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Houston Police Department-HPD     638\n",
       "Houston Fire Department (HFD)     384\n",
       "Public Works & Engineering-PWE    343\n",
       "Health & Human Services           110\n",
       "Houston Airport System (HAS)      106\n",
       "Name: DEPARTMENT, dtype: int64"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "employee.DEPARTMENT.value_counts().head() # 部门分布统计"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Male      1397\n",
       "Female     603\n",
       "Name: GENDER, dtype: int64"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "employee.GENDER.value_counts() # 性别统计"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "count      1886\n",
       "mean      55767\n",
       "std       21693\n",
       "min       24960\n",
       "25%       40170\n",
       "50%       54461\n",
       "75%       66614\n",
       "max      275000\n",
       "Name: BASE_SALARY, dtype: int32"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "employee.BASE_SALARY.describe().astype(int) # 工资统计，结果转换为整数。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [],
   "source": [
    "depts = ['Houston Police Department-HPD', \n",
    "             'Houston Fire Department (HFD)']\n",
    "criteria_dept = employee.DEPARTMENT.isin(depts)\n",
    "criteria_gender = employee.GENDER == 'Female'\n",
    "criteria_sal = (employee.BASE_SALARY >= 80000) & \\\n",
    "               (employee.BASE_SALARY <= 120000)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [],
   "source": [
    "criteria_final = criteria_dept & criteria_gender & criteria_sal # 生成布尔索引"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>UNIQUE_ID</th>\n",
       "      <th>DEPARTMENT</th>\n",
       "      <th>GENDER</th>\n",
       "      <th>BASE_SALARY</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>61</th>\n",
       "      <td>61</td>\n",
       "      <td>Houston Fire Department (HFD)</td>\n",
       "      <td>Female</td>\n",
       "      <td>96668.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>136</th>\n",
       "      <td>136</td>\n",
       "      <td>Houston Police Department-HPD</td>\n",
       "      <td>Female</td>\n",
       "      <td>81239.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>367</th>\n",
       "      <td>367</td>\n",
       "      <td>Houston Police Department-HPD</td>\n",
       "      <td>Female</td>\n",
       "      <td>86534.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>474</th>\n",
       "      <td>474</td>\n",
       "      <td>Houston Police Department-HPD</td>\n",
       "      <td>Female</td>\n",
       "      <td>91181.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>513</th>\n",
       "      <td>513</td>\n",
       "      <td>Houston Police Department-HPD</td>\n",
       "      <td>Female</td>\n",
       "      <td>81239.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     UNIQUE_ID                     DEPARTMENT  GENDER  BASE_SALARY\n",
       "61          61  Houston Fire Department (HFD)  Female      96668.0\n",
       "136        136  Houston Police Department-HPD  Female      81239.0\n",
       "367        367  Houston Police Department-HPD  Female      86534.0\n",
       "474        474  Houston Police Department-HPD  Female      91181.0\n",
       "513        513  Houston Police Department-HPD  Female      81239.0"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "select_columns = ['UNIQUE_ID', 'DEPARTMENT', 'GENDER', 'BASE_SALARY']\n",
    "employee.loc[criteria_final, select_columns].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [],
   "source": [
    "criteria_sal = employee.BASE_SALARY.between(80000, 120000)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>UNIQUE_ID</th>\n",
       "      <th>POSITION_TITLE</th>\n",
       "      <th>DEPARTMENT</th>\n",
       "      <th>BASE_SALARY</th>\n",
       "      <th>RACE</th>\n",
       "      <th>EMPLOYMENT_TYPE</th>\n",
       "      <th>GENDER</th>\n",
       "      <th>EMPLOYMENT_STATUS</th>\n",
       "      <th>HIRE_DATE</th>\n",
       "      <th>JOB_DATE</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>ASSISTANT DIRECTOR (EX LVL)</td>\n",
       "      <td>Municipal Courts Department</td>\n",
       "      <td>121862.0</td>\n",
       "      <td>Hispanic/Latino</td>\n",
       "      <td>Full Time</td>\n",
       "      <td>Female</td>\n",
       "      <td>Active</td>\n",
       "      <td>2006-06-12</td>\n",
       "      <td>2012-10-13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>LIBRARY ASSISTANT</td>\n",
       "      <td>Library</td>\n",
       "      <td>26125.0</td>\n",
       "      <td>Hispanic/Latino</td>\n",
       "      <td>Full Time</td>\n",
       "      <td>Female</td>\n",
       "      <td>Active</td>\n",
       "      <td>2000-07-19</td>\n",
       "      <td>2010-09-18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>ELECTRICIAN</td>\n",
       "      <td>General Services Department</td>\n",
       "      <td>56347.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Full Time</td>\n",
       "      <td>Male</td>\n",
       "      <td>Active</td>\n",
       "      <td>1989-06-19</td>\n",
       "      <td>1994-10-22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>18</td>\n",
       "      <td>MAINTENANCE MECHANIC III</td>\n",
       "      <td>General Services Department</td>\n",
       "      <td>40581.0</td>\n",
       "      <td>Hispanic/Latino</td>\n",
       "      <td>Full Time</td>\n",
       "      <td>Male</td>\n",
       "      <td>Active</td>\n",
       "      <td>2008-12-29</td>\n",
       "      <td>2008-12-29</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>32</td>\n",
       "      <td>SENIOR ACCOUNTANT</td>\n",
       "      <td>Finance</td>\n",
       "      <td>46963.0</td>\n",
       "      <td>Black or African American</td>\n",
       "      <td>Full Time</td>\n",
       "      <td>Male</td>\n",
       "      <td>Active</td>\n",
       "      <td>1991-02-11</td>\n",
       "      <td>2016-02-13</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    UNIQUE_ID               POSITION_TITLE                   DEPARTMENT  \\\n",
       "0           0  ASSISTANT DIRECTOR (EX LVL)  Municipal Courts Department   \n",
       "1           1            LIBRARY ASSISTANT                      Library   \n",
       "4           4                  ELECTRICIAN  General Services Department   \n",
       "18         18     MAINTENANCE MECHANIC III  General Services Department   \n",
       "32         32            SENIOR ACCOUNTANT                      Finance   \n",
       "\n",
       "    BASE_SALARY                       RACE EMPLOYMENT_TYPE  GENDER  \\\n",
       "0      121862.0            Hispanic/Latino       Full Time  Female   \n",
       "1       26125.0            Hispanic/Latino       Full Time  Female   \n",
       "4       56347.0                      White       Full Time    Male   \n",
       "18      40581.0            Hispanic/Latino       Full Time    Male   \n",
       "32      46963.0  Black or African American       Full Time    Male   \n",
       "\n",
       "   EMPLOYMENT_STATUS   HIRE_DATE    JOB_DATE  \n",
       "0             Active  2006-06-12  2012-10-13  \n",
       "1             Active  2000-07-19  2010-09-18  \n",
       "4             Active  1989-06-19  1994-10-22  \n",
       "18            Active  2008-12-29  2008-12-29  \n",
       "32            Active  1991-02-11  2016-02-13  "
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 找最多5个部门的记录\n",
    "top_5_depts = employee.DEPARTMENT.value_counts().index[:5]\n",
    "criteria = ~employee.DEPARTMENT.isin(top_5_depts)\n",
    "employee[criteria].head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 股票收益归一化统计"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Open</th>\n",
       "      <th>High</th>\n",
       "      <th>Low</th>\n",
       "      <th>Close</th>\n",
       "      <th>Volume</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2010-01-04</th>\n",
       "      <td>136.25</td>\n",
       "      <td>136.61</td>\n",
       "      <td>133.14</td>\n",
       "      <td>133.90</td>\n",
       "      <td>7600543</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-05</th>\n",
       "      <td>133.43</td>\n",
       "      <td>135.48</td>\n",
       "      <td>131.81</td>\n",
       "      <td>134.69</td>\n",
       "      <td>8856456</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-06</th>\n",
       "      <td>134.60</td>\n",
       "      <td>134.73</td>\n",
       "      <td>131.65</td>\n",
       "      <td>132.25</td>\n",
       "      <td>7180977</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-07</th>\n",
       "      <td>132.01</td>\n",
       "      <td>132.32</td>\n",
       "      <td>128.80</td>\n",
       "      <td>130.00</td>\n",
       "      <td>11030124</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-08</th>\n",
       "      <td>130.56</td>\n",
       "      <td>133.68</td>\n",
       "      <td>129.03</td>\n",
       "      <td>133.52</td>\n",
       "      <td>9833829</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              Open    High     Low   Close    Volume\n",
       "Date                                                \n",
       "2010-01-04  136.25  136.61  133.14  133.90   7600543\n",
       "2010-01-05  133.43  135.48  131.81  134.69   8856456\n",
       "2010-01-06  134.60  134.73  131.65  132.25   7180977\n",
       "2010-01-07  132.01  132.32  128.80  130.00  11030124\n",
       "2010-01-08  130.56  133.68  129.03  133.52   9833829"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "amzn = pd.read_csv('data/amzn_stock.csv', index_col='Date', parse_dates=['Date'])\n",
    "amzn.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Date\n",
       "2010-01-04         NaN\n",
       "2010-01-05    0.005900\n",
       "2010-01-06   -0.018116\n",
       "2010-01-07   -0.017013\n",
       "2010-01-08    0.027077\n",
       "Name: Close, dtype: float64"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 相比上一天的涨跌百分比\n",
    "# 01-05: (134.69 - 133.90) / 133.90\n",
    "# 01-05: (132.25 - 134.69) / 134.69\n",
    "amzn_daily_return = amzn.Close.pct_change()\n",
    "amzn_daily_return.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD4CAYAAAAXUaZHAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAATp0lEQVR4nO3df4xlZX3H8fdXVn6EsTu7glOyu+1A3GooWxGmiLU1M25VfqhLUiQ0RBa6zSYtGhu3CWtN07Rp0rUNJZAY7EZsl0Y7UKxls6AGF6aWP0B3FVl+SBlwqTvBpeCyOoCatd/+cZ+1wziz986de+fOPLxfyc095znPOff5zrnzmTPnnjkTmYkkqS6v6fUAJEmdZ7hLUoUMd0mqkOEuSRUy3CWpQst6PQCAU045JQcHB3s9jJa9+OKLnHzyyb0eRkfVWBNY11JSY03Q3br27t37XGaeOtOyRRHug4OD7Nmzp9fDaNnY2BjDw8O9HkZH1VgTWNdSUmNN0N26IuLp2ZZ5WkaSKmS4S1KFDHdJqpDhLkkVMtwlqUKGuyRVyHCXpAoZ7pJUIcNdkiq0KP5CVWpmcOudba23Zd0Rhjs7FGlJ8MhdkipkuEtShQx3SaqQ4S5JFTLcJalChrskVchwl6QKGe6SVCHDXZIqZLhLUoUMd0mqUEvhHhH9EXF7RHwnIh6LiLdHxMqIuDsinijPK0rfiIgbI2I8Ih6KiHO6W4IkabpWj9xvAL6cmW8G3gI8BmwFdmfmWmB3mQe4EFhbHpuBmzo6YklSU03DPSKWA+8EbgbIzJ9m5gvABmBH6bYDuKRMbwBuyYb7gf6IOK3D45YkHUNk5rE7RJwNbAcepXHUvhf4KDCRmf2lTwCHMrM/InYB2zLzvrJsN3BtZu6Ztt3NNI7sGRgYOHd0dLSDZXXX5OQkfX19vR5GRy32mvZNHG5rvYGT4A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I1fTXsV7q3c5uJonwMRsQxYTmPfLNZbZLRdUzZO5P4EIDP3RsSTwK8Be7o+6ubm8/We9f3YY/N6D035XnoqIsaAt9I4h98xnpaZ3U7g6CfzG4E7Wl2xfKPdCxz9hHxO63dRKzV9BXhPRKwoV9O8B/hKRCyLiFMAIuK1wPuAhxdgzLNp5TYXU+u9FLin7JudwOXlypPTgbXA1xdo3MfSdk0RcWo0/pcC5WhwLY0PHxeD+dySZMb3Y5fGORdt11RqOaFMnwK8g27cEr3Xnzov1geN85i7gSeArwIrS/sQ8Jkp/f4T+B/gZRrn3d5b2s+gERjjwL8CJyyhmv6gjHscuLq0nQzsBR4CHgFuoMdXmAAXAf9F44jnE6Xtr4APlOkTy9d+vOyLM6as+4my3uPAhb3eN/OtCfi9sl8eBL4JvL/Xtcyxrt8s3z8v0vjt6pFjvR8Xw6PdmoDfAvbRuMJmH7CpG+Pz9gOSVCFPy0hShQx3SaqQ4S5JFTLcJalChrskVchwl6QKGe6SVKH/AzY3+NVNS2tOAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "amzn_daily_return = amzn_daily_return.dropna()\n",
    "amzn_daily_return.hist(bins=20) # 直方图，统计各个区间内值的数量。大多数还是在0附近波动。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0.0012631309530525428, 0.019861559267099135)"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mean = amzn_daily_return.mean() # 平均值与方差\n",
    "std = amzn_daily_return.std()\n",
    "mean, std"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [],
   "source": [
    "abs_z_score = amzn_daily_return.sub(mean).abs().div(std)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.787 fall within 1 standard deviation. 0.956 within 2 and 0.985 within 3\n"
     ]
    }
   ],
   "source": [
    "pcts = [abs_z_score.lt(i).mean() for i in range(1,4)]\n",
    "print('{:.3f} fall within 1 standard deviation. '\n",
    "      '{:.3f} within 2 and {:.3f} within 3'.format(*pcts)) # 落在不同方差的比例，如果是标准正态分布可以直接查到。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [],
   "source": [
    "def test_return_normality(stock_data):\n",
    "    close = stock_data['Close']\n",
    "    daily_return = close.pct_change().dropna()\n",
    "    daily_return.hist(bins=20)\n",
    "    mean = daily_return.mean() \n",
    "    std = daily_return.std()\n",
    "    \n",
    "    abs_z_score = abs(daily_return - mean) / std\n",
    "    pcts = [abs_z_score.lt(i).mean() for i in range(1,4)]\n",
    "\n",
    "    print('{:.3f} fall within 1 standard deviation. '\n",
    "          '{:.3f} within 2 and {:.3f} within 3'.format(*pcts))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.742 fall within 1 standard deviation. 0.946 within 2 and 0.986 within 3\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD4CAYAAAAXUaZHAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAARoklEQVR4nO3df4zkdX3H8ecbThA5vQPBLeWuXYxYg1z8wUZoTJs9qPWA6tH6o5iL3lnMtSkmNl4Tz9qmsTHx0FCU2GguYns0rQvFWiinafBka/0DlRXkQGrZO8/2tvQoeF49QJpr3/1jPkuHdfZmdmdmZ+dzz0cyme/38/18v/Oe7373td/9fr/znchMJEl1O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2Os5qR/rtayP/TROiM6eTHvlnD4t1wvwSp57QnU/jZNzbZc5gFpXl/6/0WKZLbeHAdZ6NnByGX4pjWCd3R7mnlC9YpC1lvGTSo0v7fd67ep9DvLFB/rGG8fP9gCPAF9p2pjGaHx71Gy/36Jx4mwaePecZewHXjGn7aM0TmB9B7h77vSlrhU4ncbVPA+Uuj7Z9Iv0fOBvSv9vNm+sA6p1DZDAw8D95fGeXq9X4ArgX2hcMfGh0vYnwJvbrRcah5720bhF9eXHW2aPttNF1Qr8IfBk03q8n8aJ/3m3hwHW+pZSy/00TqK/qWmZY8CDZZmfonyqflC1lmnjzNm56Od6XezD2w9IUoVO5KtlJKlahrskVchwl6QKGe6SVCHDXZIqZLhLUoUMd0mq0P8B+yGnZaKfDesAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "slb = pd.read_csv('data/slb_stock.csv', \n",
    "                  index_col='Date', parse_dates=['Date'])\n",
    "test_return_normality(slb)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 改进使用布尔索引查询代码的可读性"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [],
   "source": [
    "employee = pd.read_csv('data/employee.csv')\n",
    "depts = ['Houston Police Department-HPD', 'Houston Fire Department (HFD)']\n",
    "select_columns = ['UNIQUE_ID', 'DEPARTMENT', 'GENDER', 'BASE_SALARY']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>UNIQUE_ID</th>\n",
       "      <th>DEPARTMENT</th>\n",
       "      <th>GENDER</th>\n",
       "      <th>BASE_SALARY</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>61</th>\n",
       "      <td>61</td>\n",
       "      <td>Houston Fire Department (HFD)</td>\n",
       "      <td>Female</td>\n",
       "      <td>96668.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>136</th>\n",
       "      <td>136</td>\n",
       "      <td>Houston Police Department-HPD</td>\n",
       "      <td>Female</td>\n",
       "      <td>81239.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>367</th>\n",
       "      <td>367</td>\n",
       "      <td>Houston Police Department-HPD</td>\n",
       "      <td>Female</td>\n",
       "      <td>86534.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>474</th>\n",
       "      <td>474</td>\n",
       "      <td>Houston Police Department-HPD</td>\n",
       "      <td>Female</td>\n",
       "      <td>91181.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>513</th>\n",
       "      <td>513</td>\n",
       "      <td>Houston Police Department-HPD</td>\n",
       "      <td>Female</td>\n",
       "      <td>81239.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     UNIQUE_ID                     DEPARTMENT  GENDER  BASE_SALARY\n",
       "61          61  Houston Fire Department (HFD)  Female      96668.0\n",
       "136        136  Houston Police Department-HPD  Female      81239.0\n",
       "367        367  Houston Police Department-HPD  Female      86534.0\n",
       "474        474  Houston Police Department-HPD  Female      91181.0\n",
       "513        513  Houston Police Department-HPD  Female      81239.0"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "qs = \"DEPARTMENT in @depts \" \\\n",
    "         \"and GENDER == 'Female' \" \\\n",
    "         \"and 80000 <= BASE_SALARY <= 120000\"\n",
    "        \n",
    "emp_filtered = employee.query(qs) # 查询，返回指定行。@会自动找变量匹配。\n",
    "emp_filtered[select_columns].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>DEPARTMENT</th>\n",
       "      <th>GENDER</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Municipal Courts Department</td>\n",
       "      <td>Female</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>73</th>\n",
       "      <td>Human Resources Dept.</td>\n",
       "      <td>Female</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>96</th>\n",
       "      <td>City Controller's Office</td>\n",
       "      <td>Female</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>117</th>\n",
       "      <td>Legal Department</td>\n",
       "      <td>Female</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>146</th>\n",
       "      <td>Houston Information Tech Svcs</td>\n",
       "      <td>Female</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                        DEPARTMENT  GENDER\n",
       "0      Municipal Courts Department  Female\n",
       "73           Human Resources Dept.  Female\n",
       "96        City Controller's Office  Female\n",
       "117               Legal Department  Female\n",
       "146  Houston Information Tech Svcs  Female"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "top10_depts = employee.DEPARTMENT.value_counts().index[:10].tolist()\n",
    "qs = \"DEPARTMENT not in @top10_depts and GENDER == 'Female'\"\n",
    "employee_filtered2 = employee.query(qs)\n",
    "employee_filtered2[['DEPARTMENT', 'GENDER']].head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## where查询返回Series"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "movie_title\n",
       "Avatar                                         1000.0\n",
       "Pirates of the Caribbean: At World's End      40000.0\n",
       "Spectre                                       11000.0\n",
       "The Dark Knight Rises                         27000.0\n",
       "Star Wars: Episode VII - The Force Awakens      131.0\n",
       "Name: actor_1_facebook_likes, dtype: float64"
      ]
     },
     "execution_count": 67,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "movie = pd.read_csv('data/movie.csv', index_col='movie_title')\n",
    "fb_likes = movie['actor_1_facebook_likes'].dropna()\n",
    "fb_likes.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "count      4909\n",
       "mean       6494\n",
       "std       15106\n",
       "min           0\n",
       "10%         240\n",
       "25%         607\n",
       "50%         982\n",
       "75%       11000\n",
       "90%       18000\n",
       "max      640000\n",
       "Name: actor_1_facebook_likes, dtype: int32"
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fb_likes.describe(percentiles=[.1, .25, .5, .75, .9]).astype(int) # 输出指定分位数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "count      4909.000000\n",
       "mean       6494.488491\n",
       "std       15106.986884\n",
       "min           0.000000\n",
       "10%         240.000000\n",
       "25%         607.000000\n",
       "50%         982.000000\n",
       "75%       11000.000000\n",
       "90%       18000.000000\n",
       "max      640000.000000\n",
       "Name: actor_1_facebook_likes, dtype: float64"
      ]
     },
     "execution_count": 69,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fb_likes.describe(percentiles=[.1,.25,.5,.75,.9]) # 不转整数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 70,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD4CAYAAAAAczaOAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAATd0lEQVR4nO3de4xc5XnH8e8TzK2YYgPpyrKt2lGsRk5pCFmBUaJoAcVcEsX8QSIjVBxKZamlaqIiJdAoRUlAgiqEBJqQWMWtE5EYSkJtkbTUNayi/MHN4WIuIV7AFFsEN9g4XXJRnT79Y94lE7OX2d3x7B6/3480mnPe8573fQ4++c3smTOTyEwkSXV4y0wXIEnqHUNfkipi6EtSRQx9SaqIoS9JFZkz0wWM5+STT84lS5ZMef/XX3+d4447rnsF9VCTa4dm19/k2qHZ9Te5dpg99W/btu1nmfnW0bbN6tBfsmQJjzzyyJT3HxwcZGBgoHsF9VCTa4dm19/k2qHZ9Te5dpg99UfEi2Nt8/KOJFWko9CPiJ0RsT0iHouIR0rbiRGxJSJ2lOf5pT0i4uaIGIqIJyLitLZx1pT+OyJizaE5JEnSWCbzTv+szDw1M/vL+lXA1sxcBmwt6wDnA8vKYy1wK7ReJIBrgDOA04FrRl4oJEm9MZ3LO6uADWV5A3BhW/s3suUBYF5ELADOBbZk5t7M3AdsAc6bxvySpEmKTn57JyJeAPYBCXw9M9dFxGuZ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2ma5lGt6XmafR+hXdKyLi/e0bZ/N5Q+uvpdOAWzPz3cDrtC61dGPsjvVijsMx9GfjTz28EhELAMrzntI+Vq3jtS8apX28OSYtIo6kFfi3Z+Z3m3gMmfkacD+tyxXzImLki4jt871RY9l+AvDqFI7p1XHm6NR7gQ9HxE5gI61LPF9uSO0AZObu8rwHuJvWi25TzptdwK7MfLCs30XrRaAp9XfscAz92fhTD5uBkU/x19C6Tj7Sfmm5E2AFsL/8mXcvsDIi5pdP8lfSus76MvDziFhRPvm/9KCxRptjUsq4twHPZOYXm3QMEfHWiJhXlo+l9VnEM7TC/6Ixah+Z7yLgvvJOazOwOlp3yCwFltH6EG7Uc6vsM9YcHcnMqzNzUWYuKePel5mXNKF2gIg4LiKOH1mm9e/9JA04bwAy86fASxHxR6XpHFo/+d6I+iflUH5gMFMPWp+s/4TW9dxP93jubwMvA/9L693D5bSum24FdgD/CZxY+gat/1OZ54DtQH/bOH8GDJXHZW3t/bT+x/Qc8A/89lvVo84xhfrfR+vPyyeAx8rjgiYcA/AnwKOl9ieBvyvtb6MVfEPAvwBHl/ZjyvpQ2f62trE+Xep7lnKXxXjn1lhzTPHfYIDf3r3TiNrLGI+Xx1Mj4zfhvGkb/1TgkXL+/Cutu28aU3+nD3+GQZIqcjhe3pEkjcHQl6SKGPqSVBFDX5IqYuhLUkUMfUmqiKEvSRX5f/3k+7dZYSTkAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fb_likes.hist() #数值分布"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.91"
      ]
     },
     "execution_count": 71,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "criteria_high = fb_likes < 20000\n",
    "criteria_high.mean().round(2) # 保留2位小数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "movie_title\n",
       "Avatar                                         1000.0\n",
       "Pirates of the Caribbean: At World's End          NaN\n",
       "Spectre                                       11000.0\n",
       "The Dark Knight Rises                             NaN\n",
       "Star Wars: Episode VII - The Force Awakens      131.0\n",
       "Name: actor_1_facebook_likes, dtype: float64"
      ]
     },
     "execution_count": 72,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fb_likes.where(criteria_high).head() # where + 查询条件"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "movie_title\n",
       "Avatar                                         1000.0\n",
       "Pirates of the Caribbean: At World's End      20000.0\n",
       "Spectre                                       11000.0\n",
       "The Dark Knight Rises                         20000.0\n",
       "Star Wars: Episode VII - The Force Awakens      131.0\n",
       "Name: actor_1_facebook_likes, dtype: float64"
      ]
     },
     "execution_count": 73,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fb_likes.where(criteria_high, other=20000).head() # 大于20000的替换为20000"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "movie_title\n",
       "Avatar                                         1000.0\n",
       "Pirates of the Caribbean: At World's End      20000.0\n",
       "Spectre                                       11000.0\n",
       "The Dark Knight Rises                         20000.0\n",
       "Star Wars: Episode VII - The Force Awakens      300.0\n",
       "Name: actor_1_facebook_likes, dtype: float64"
      ]
     },
     "execution_count": 74,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "criteria_low = fb_likes > 300\n",
    "fb_likes_cap = fb_likes.where(criteria_high, other=20000).where(criteria_low, 300)\n",
    "fb_likes_cap.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(4909, 4909)"
      ]
     },
     "execution_count": 75,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(fb_likes), len(fb_likes_cap)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 76,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD4CAYAAAAAczaOAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAWMUlEQVR4nO3dfWxd9X3H8fenCdAJ0yQMZmUha9I17RRApcQCpj7ILiox6bbQrUNBiCZAlW4LUlmZ1NCqg5UipY9sqJTOXSJCS2vSB0QUwmia4SI0hYfQlDxQGhPChpUmKgmhbju2sO/+OL9o1+61fX2ffMjv85KufO7vnHPP5xw7H997zr2OIgIzM8vDG6Y6gJmZtY9L38wsIy59M7OMuPTNzDLi0jczy8j0qQ4wnjPOOCPmzZtX07K/+tWvOPXUU1sbqE5lzVbWXOBs9ShrLihvtrLmgsaybd++/RcRcWbVmRFR2tuiRYuiVg8//HDNy7ZbWbOVNVeEs9WjrLkiyputrLkiGssGPBlj9KpP75iZZcSlb2aWEZe+mVlGXPpmZhlx6ZuZZcSlb2aWEZe+mVlGXPpmZhlx6ZuZZaTUf4ahUfNWPzAl292/5gNTsl0zs4n4mb6ZWUZc+mZmGXHpm5llxKVvZpYRl76ZWUYmLH1Jb5T0uKSfSNot6R/S+HxJj0kalHSvpJPT+Cnp/mCaP6/isW5M489KWtyyvTIzs6pqeab/KvC+iHgHcB7QK+ki4HPAbRHxVuAIcG1a/lrgSBq/LS2HpIXAMuBsoBf4qqRpTdwXMzObwISln/4jluF096R0C+B9wHfT+HrgsjS9NN0nzb9YktJ4f0S8GhHPA4PABc3YCTMzq42K/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R59P0x9g5IWjx+P/Lxw9T3HRaFaaPr0Jx64fuLoMx4xRF/SaeYz47YtrSxrI1QvsAc4ctdyZwLQ0/RaKf+zjbn+sfWwgW9O+fxSv/iov5P5NI9kqjt2Ppuq4MXZXTNnPWsuKsZ03iiveP6P4jf2pNmzv3RQvx54GdqTbEuAbwM40vnHUP4hPpXzPUnF1vdnZ0w/xT9Jt9/HHpDhnuhXYC/yw4gdGFP+xzXMpe1fFY11DcQFukIqibiDbqRTP6GZUjE3JMaN4uX8A+B+K86DXNvMYAV3ArrTOV0iffq8z1yDF+dzjP2tfS8v+Rfoe7wCeAv50ou2PtY8NZGva9y/97D6e9vc7wCmNZEvjdwF/NWrZth03xu6KKftZ859hMDPLyIlwTt/MzGrk0jczy4hL38wsIy59M7OMuPTNzDLi0jczy4hL38wsI/8HnDEqYijF2OIAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fb_likes_cap.hist() # fb_likes_cap经过上面的处理，下限变成300，上限变成20000。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "count     4909.000000\n",
       "mean      5344.456508\n",
       "std       6954.646407\n",
       "min        300.000000\n",
       "10%        300.000000\n",
       "25%        607.000000\n",
       "50%        982.000000\n",
       "75%      11000.000000\n",
       "90%      18000.000000\n",
       "max      20000.000000\n",
       "Name: actor_1_facebook_likes, dtype: float64"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fb_likes_cap.describe(percentiles=[.1,.25,.5,.75,.9]) # 可以和fb_likes的统计对比一下，看看有什么变化。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "movie_title\n",
       "Avatar                                         1000.0\n",
       "Pirates of the Caribbean: At World's End      40000.0\n",
       "Spectre                                       11000.0\n",
       "The Dark Knight Rises                         27000.0\n",
       "Star Wars: Episode VII - The Force Awakens      131.0\n",
       "                                               ...   \n",
       "Signed Sealed Delivered                         637.0\n",
       "The Following                                   841.0\n",
       "A Plague So Pleasant                              0.0\n",
       "Shanghai Calling                                946.0\n",
       "My Date with Drew                                86.0\n",
       "Name: actor_1_facebook_likes, Length: 4909, dtype: float64"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fb_likes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fb_likes_cap2 = fb_likes.clip(lower=300, upper=20000) # clip直接处理上下限\n",
    "fb_likes_cap2.equals(fb_likes_cap)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 使用mask函数按行处理数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [],
   "source": [
    "movie = pd.read_csv('data/movie.csv', index_col='movie_title')\n",
    "c1 = movie['title_year'] >= 2010\n",
    "c2 = movie['title_year'].isnull()\n",
    "criteria = c1 | c2 # 筛选标准是2010年及以后或没有年份"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>color</th>\n",
       "      <th>director_name</th>\n",
       "      <th>num_critic_for_reviews</th>\n",
       "      <th>duration</th>\n",
       "      <th>director_facebook_likes</th>\n",
       "      <th>actor_3_facebook_likes</th>\n",
       "      <th>actor_2_name</th>\n",
       "      <th>actor_1_facebook_likes</th>\n",
       "      <th>gross</th>\n",
       "      <th>genres</th>\n",
       "      <th>actor_1_name</th>\n",
       "      <th>num_voted_users</th>\n",
       "      <th>cast_total_facebook_likes</th>\n",
       "      <th>actor_3_name</th>\n",
       "      <th>facenumber_in_poster</th>\n",
       "      <th>plot_keywords</th>\n",
       "      <th>movie_imdb_link</th>\n",
       "      <th>num_user_for_reviews</th>\n",
       "      <th>language</th>\n",
       "      <th>country</th>\n",
       "      <th>content_rating</th>\n",
       "      <th>budget</th>\n",
       "      <th>title_year</th>\n",
       "      <th>actor_2_facebook_likes</th>\n",
       "      <th>imdb_score</th>\n",
       "      <th>aspect_ratio</th>\n",
       "      <th>movie_facebook_likes</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>movie_title</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Avatar</th>\n",
       "      <td>Color</td>\n",
       "      <td>James Cameron</td>\n",
       "      <td>723.0</td>\n",
       "      <td>178.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>855.0</td>\n",
       "      <td>Joel David Moore</td>\n",
       "      <td>1000.0</td>\n",
       "      <td>760505847.0</td>\n",
       "      <td>Action|Adventure|Fantasy|Sci-Fi</td>\n",
       "      <td>CCH Pounder</td>\n",
       "      <td>886204.0</td>\n",
       "      <td>4834.0</td>\n",
       "      <td>Wes Studi</td>\n",
       "      <td>0.0</td>\n",
       "      <td>avatar|future|marine|native|paraplegic</td>\n",
       "      <td>http://www.imdb.com/title/tt0499549/?ref_=fn_t...</td>\n",
       "      <td>3054.0</td>\n",
       "      <td>English</td>\n",
       "      <td>USA</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>237000000.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>936.0</td>\n",
       "      <td>7.9</td>\n",
       "      <td>1.78</td>\n",
       "      <td>33000.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Pirates of the Caribbean: At World's End</th>\n",
       "      <td>Color</td>\n",
       "      <td>Gore Verbinski</td>\n",
       "      <td>302.0</td>\n",
       "      <td>169.0</td>\n",
       "      <td>563.0</td>\n",
       "      <td>1000.0</td>\n",
       "      <td>Orlando Bloom</td>\n",
       "      <td>40000.0</td>\n",
       "      <td>309404152.0</td>\n",
       "      <td>Action|Adventure|Fantasy</td>\n",
       "      <td>Johnny Depp</td>\n",
       "      <td>471220.0</td>\n",
       "      <td>48350.0</td>\n",
       "      <td>Jack Davenport</td>\n",
       "      <td>0.0</td>\n",
       "      <td>goddess|marriage ceremony|marriage proposal|pi...</td>\n",
       "      <td>http://www.imdb.com/title/tt0449088/?ref_=fn_t...</td>\n",
       "      <td>1238.0</td>\n",
       "      <td>English</td>\n",
       "      <td>USA</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>300000000.0</td>\n",
       "      <td>2007.0</td>\n",
       "      <td>5000.0</td>\n",
       "      <td>7.1</td>\n",
       "      <td>2.35</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Spectre</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>The Dark Knight Rises</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Star Wars: Episode VII - The Force Awakens</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                            color   director_name  \\\n",
       "movie_title                                                         \n",
       "Avatar                                      Color   James Cameron   \n",
       "Pirates of the Caribbean: At World's End    Color  Gore Verbinski   \n",
       "Spectre                                       NaN             NaN   \n",
       "The Dark Knight Rises                         NaN             NaN   \n",
       "Star Wars: Episode VII - The Force Awakens    NaN             NaN   \n",
       "\n",
       "                                            num_critic_for_reviews  duration  \\\n",
       "movie_title                                                                    \n",
       "Avatar                                                       723.0     178.0   \n",
       "Pirates of the Caribbean: At World's End                     302.0     169.0   \n",
       "Spectre                                                        NaN       NaN   \n",
       "The Dark Knight Rises                                          NaN       NaN   \n",
       "Star Wars: Episode VII - The Force Awakens                     NaN       NaN   \n",
       "\n",
       "                                            director_facebook_likes  \\\n",
       "movie_title                                                           \n",
       "Avatar                                                          0.0   \n",
       "Pirates of the Caribbean: At World's End                      563.0   \n",
       "Spectre                                                         NaN   \n",
       "The Dark Knight Rises                                           NaN   \n",
       "Star Wars: Episode VII - The Force Awakens                      NaN   \n",
       "\n",
       "                                            actor_3_facebook_likes  \\\n",
       "movie_title                                                          \n",
       "Avatar                                                       855.0   \n",
       "Pirates of the Caribbean: At World's End                    1000.0   \n",
       "Spectre                                                        NaN   \n",
       "The Dark Knight Rises                                          NaN   \n",
       "Star Wars: Episode VII - The Force Awakens                     NaN   \n",
       "\n",
       "                                                actor_2_name  \\\n",
       "movie_title                                                    \n",
       "Avatar                                      Joel David Moore   \n",
       "Pirates of the Caribbean: At World's End       Orlando Bloom   \n",
       "Spectre                                                  NaN   \n",
       "The Dark Knight Rises                                    NaN   \n",
       "Star Wars: Episode VII - The Force Awakens               NaN   \n",
       "\n",
       "                                            actor_1_facebook_likes  \\\n",
       "movie_title                                                          \n",
       "Avatar                                                      1000.0   \n",
       "Pirates of the Caribbean: At World's End                   40000.0   \n",
       "Spectre                                                        NaN   \n",
       "The Dark Knight Rises                                          NaN   \n",
       "Star Wars: Episode VII - The Force Awakens                     NaN   \n",
       "\n",
       "                                                  gross  \\\n",
       "movie_title                                               \n",
       "Avatar                                      760505847.0   \n",
       "Pirates of the Caribbean: At World's End    309404152.0   \n",
       "Spectre                                             NaN   \n",
       "The Dark Knight Rises                               NaN   \n",
       "Star Wars: Episode VII - The Force Awakens          NaN   \n",
       "\n",
       "                                                                     genres  \\\n",
       "movie_title                                                                   \n",
       "Avatar                                      Action|Adventure|Fantasy|Sci-Fi   \n",
       "Pirates of the Caribbean: At World's End           Action|Adventure|Fantasy   \n",
       "Spectre                                                                 NaN   \n",
       "The Dark Knight Rises                                                   NaN   \n",
       "Star Wars: Episode VII - The Force Awakens                              NaN   \n",
       "\n",
       "                                           actor_1_name  num_voted_users  \\\n",
       "movie_title                                                                \n",
       "Avatar                                      CCH Pounder         886204.0   \n",
       "Pirates of the Caribbean: At World's End    Johnny Depp         471220.0   \n",
       "Spectre                                             NaN              NaN   \n",
       "The Dark Knight Rises                               NaN              NaN   \n",
       "Star Wars: Episode VII - The Force Awakens          NaN              NaN   \n",
       "\n",
       "                                            cast_total_facebook_likes  \\\n",
       "movie_title                                                             \n",
       "Avatar                                                         4834.0   \n",
       "Pirates of the Caribbean: At World's End                      48350.0   \n",
       "Spectre                                                           NaN   \n",
       "The Dark Knight Rises                                             NaN   \n",
       "Star Wars: Episode VII - The Force Awakens                        NaN   \n",
       "\n",
       "                                              actor_3_name  \\\n",
       "movie_title                                                  \n",
       "Avatar                                           Wes Studi   \n",
       "Pirates of the Caribbean: At World's End    Jack Davenport   \n",
       "Spectre                                                NaN   \n",
       "The Dark Knight Rises                                  NaN   \n",
       "Star Wars: Episode VII - The Force Awakens             NaN   \n",
       "\n",
       "                                            facenumber_in_poster  \\\n",
       "movie_title                                                        \n",
       "Avatar                                                       0.0   \n",
       "Pirates of the Caribbean: At World's End                     0.0   \n",
       "Spectre                                                      NaN   \n",
       "The Dark Knight Rises                                        NaN   \n",
       "Star Wars: Episode VII - The Force Awakens                   NaN   \n",
       "\n",
       "                                                                                plot_keywords  \\\n",
       "movie_title                                                                                     \n",
       "Avatar                                                 avatar|future|marine|native|paraplegic   \n",
       "Pirates of the Caribbean: At World's End    goddess|marriage ceremony|marriage proposal|pi...   \n",
       "Spectre                                                                                   NaN   \n",
       "The Dark Knight Rises                                                                     NaN   \n",
       "Star Wars: Episode VII - The Force Awakens                                                NaN   \n",
       "\n",
       "                                                                              movie_imdb_link  \\\n",
       "movie_title                                                                                     \n",
       "Avatar                                      http://www.imdb.com/title/tt0499549/?ref_=fn_t...   \n",
       "Pirates of the Caribbean: At World's End    http://www.imdb.com/title/tt0449088/?ref_=fn_t...   \n",
       "Spectre                                                                                   NaN   \n",
       "The Dark Knight Rises                                                                     NaN   \n",
       "Star Wars: Episode VII - The Force Awakens                                                NaN   \n",
       "\n",
       "                                            num_user_for_reviews language  \\\n",
       "movie_title                                                                 \n",
       "Avatar                                                    3054.0  English   \n",
       "Pirates of the Caribbean: At World's End                  1238.0  English   \n",
       "Spectre                                                      NaN      NaN   \n",
       "The Dark Knight Rises                                        NaN      NaN   \n",
       "Star Wars: Episode VII - The Force Awakens                   NaN      NaN   \n",
       "\n",
       "                                           country content_rating  \\\n",
       "movie_title                                                         \n",
       "Avatar                                         USA          PG-13   \n",
       "Pirates of the Caribbean: At World's End       USA          PG-13   \n",
       "Spectre                                        NaN            NaN   \n",
       "The Dark Knight Rises                          NaN            NaN   \n",
       "Star Wars: Episode VII - The Force Awakens     NaN            NaN   \n",
       "\n",
       "                                                 budget  title_year  \\\n",
       "movie_title                                                           \n",
       "Avatar                                      237000000.0      2009.0   \n",
       "Pirates of the Caribbean: At World's End    300000000.0      2007.0   \n",
       "Spectre                                             NaN         NaN   \n",
       "The Dark Knight Rises                               NaN         NaN   \n",
       "Star Wars: Episode VII - The Force Awakens          NaN         NaN   \n",
       "\n",
       "                                            actor_2_facebook_likes  \\\n",
       "movie_title                                                          \n",
       "Avatar                                                       936.0   \n",
       "Pirates of the Caribbean: At World's End                    5000.0   \n",
       "Spectre                                                        NaN   \n",
       "The Dark Knight Rises                                          NaN   \n",
       "Star Wars: Episode VII - The Force Awakens                     NaN   \n",
       "\n",
       "                                            imdb_score  aspect_ratio  \\\n",
       "movie_title                                                            \n",
       "Avatar                                             7.9          1.78   \n",
       "Pirates of the Caribbean: At World's End           7.1          2.35   \n",
       "Spectre                                            NaN           NaN   \n",
       "The Dark Knight Rises                              NaN           NaN   \n",
       "Star Wars: Episode VII - The Force Awakens         NaN           NaN   \n",
       "\n",
       "                                            movie_facebook_likes  \n",
       "movie_title                                                       \n",
       "Avatar                                                   33000.0  \n",
       "Pirates of the Caribbean: At World's End                     0.0  \n",
       "Spectre                                                      NaN  \n",
       "The Dark Knight Rises                                        NaN  \n",
       "Star Wars: Episode VII - The Force Awakens                   NaN  "
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "movie.mask(criteria).head() # 不加参数的话就是简单按条件筛选数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>color</th>\n",
       "      <th>director_name</th>\n",
       "      <th>num_critic_for_reviews</th>\n",
       "      <th>duration</th>\n",
       "      <th>director_facebook_likes</th>\n",
       "      <th>actor_3_facebook_likes</th>\n",
       "      <th>actor_2_name</th>\n",
       "      <th>actor_1_facebook_likes</th>\n",
       "      <th>gross</th>\n",
       "      <th>genres</th>\n",
       "      <th>actor_1_name</th>\n",
       "      <th>num_voted_users</th>\n",
       "      <th>cast_total_facebook_likes</th>\n",
       "      <th>actor_3_name</th>\n",
       "      <th>facenumber_in_poster</th>\n",
       "      <th>plot_keywords</th>\n",
       "      <th>movie_imdb_link</th>\n",
       "      <th>num_user_for_reviews</th>\n",
       "      <th>language</th>\n",
       "      <th>country</th>\n",
       "      <th>content_rating</th>\n",
       "      <th>budget</th>\n",
       "      <th>title_year</th>\n",
       "      <th>actor_2_facebook_likes</th>\n",
       "      <th>imdb_score</th>\n",
       "      <th>aspect_ratio</th>\n",
       "      <th>movie_facebook_likes</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>movie_title</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Avatar</th>\n",
       "      <td>Color</td>\n",
       "      <td>James Cameron</td>\n",
       "      <td>723.0</td>\n",
       "      <td>178.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>855.0</td>\n",
       "      <td>Joel David Moore</td>\n",
       "      <td>1000.0</td>\n",
       "      <td>760505847.0</td>\n",
       "      <td>Action|Adventure|Fantasy|Sci-Fi</td>\n",
       "      <td>CCH Pounder</td>\n",
       "      <td>886204.0</td>\n",
       "      <td>4834.0</td>\n",
       "      <td>Wes Studi</td>\n",
       "      <td>0.0</td>\n",
       "      <td>avatar|future|marine|native|paraplegic</td>\n",
       "      <td>http://www.imdb.com/title/tt0499549/?ref_=fn_t...</td>\n",
       "      <td>3054.0</td>\n",
       "      <td>English</td>\n",
       "      <td>USA</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>237000000.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>936.0</td>\n",
       "      <td>7.9</td>\n",
       "      <td>1.78</td>\n",
       "      <td>33000.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Pirates of the Caribbean: At World's End</th>\n",
       "      <td>Color</td>\n",
       "      <td>Gore Verbinski</td>\n",
       "      <td>302.0</td>\n",
       "      <td>169.0</td>\n",
       "      <td>563.0</td>\n",
       "      <td>1000.0</td>\n",
       "      <td>Orlando Bloom</td>\n",
       "      <td>40000.0</td>\n",
       "      <td>309404152.0</td>\n",
       "      <td>Action|Adventure|Fantasy</td>\n",
       "      <td>Johnny Depp</td>\n",
       "      <td>471220.0</td>\n",
       "      <td>48350.0</td>\n",
       "      <td>Jack Davenport</td>\n",
       "      <td>0.0</td>\n",
       "      <td>goddess|marriage ceremony|marriage proposal|pi...</td>\n",
       "      <td>http://www.imdb.com/title/tt0449088/?ref_=fn_t...</td>\n",
       "      <td>1238.0</td>\n",
       "      <td>English</td>\n",
       "      <td>USA</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>300000000.0</td>\n",
       "      <td>2007.0</td>\n",
       "      <td>5000.0</td>\n",
       "      <td>7.1</td>\n",
       "      <td>2.35</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Spider-Man 3</th>\n",
       "      <td>Color</td>\n",
       "      <td>Sam Raimi</td>\n",
       "      <td>392.0</td>\n",
       "      <td>156.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4000.0</td>\n",
       "      <td>James Franco</td>\n",
       "      <td>24000.0</td>\n",
       "      <td>336530303.0</td>\n",
       "      <td>Action|Adventure|Romance</td>\n",
       "      <td>J.K. Simmons</td>\n",
       "      <td>383056.0</td>\n",
       "      <td>46055.0</td>\n",
       "      <td>Kirsten Dunst</td>\n",
       "      <td>0.0</td>\n",
       "      <td>sandman|spider man|symbiote|venom|villain</td>\n",
       "      <td>http://www.imdb.com/title/tt0413300/?ref_=fn_t...</td>\n",
       "      <td>1902.0</td>\n",
       "      <td>English</td>\n",
       "      <td>USA</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>258000000.0</td>\n",
       "      <td>2007.0</td>\n",
       "      <td>11000.0</td>\n",
       "      <td>6.2</td>\n",
       "      <td>2.35</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Harry Potter and the Half-Blood Prince</th>\n",
       "      <td>Color</td>\n",
       "      <td>David Yates</td>\n",
       "      <td>375.0</td>\n",
       "      <td>153.0</td>\n",
       "      <td>282.0</td>\n",
       "      <td>10000.0</td>\n",
       "      <td>Daniel Radcliffe</td>\n",
       "      <td>25000.0</td>\n",
       "      <td>301956980.0</td>\n",
       "      <td>Adventure|Family|Fantasy|Mystery</td>\n",
       "      <td>Alan Rickman</td>\n",
       "      <td>321795.0</td>\n",
       "      <td>58753.0</td>\n",
       "      <td>Rupert Grint</td>\n",
       "      <td>3.0</td>\n",
       "      <td>blood|book|love|potion|professor</td>\n",
       "      <td>http://www.imdb.com/title/tt0417741/?ref_=fn_t...</td>\n",
       "      <td>973.0</td>\n",
       "      <td>English</td>\n",
       "      <td>UK</td>\n",
       "      <td>PG</td>\n",
       "      <td>250000000.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>11000.0</td>\n",
       "      <td>7.5</td>\n",
       "      <td>2.35</td>\n",
       "      <td>10000.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Superman Returns</th>\n",
       "      <td>Color</td>\n",
       "      <td>Bryan Singer</td>\n",
       "      <td>434.0</td>\n",
       "      <td>169.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>903.0</td>\n",
       "      <td>Marlon Brando</td>\n",
       "      <td>18000.0</td>\n",
       "      <td>200069408.0</td>\n",
       "      <td>Action|Adventure|Sci-Fi</td>\n",
       "      <td>Kevin Spacey</td>\n",
       "      <td>240396.0</td>\n",
       "      <td>29991.0</td>\n",
       "      <td>Frank Langella</td>\n",
       "      <td>0.0</td>\n",
       "      <td>crystal|epic|lex luthor|lois lane|return to earth</td>\n",
       "      <td>http://www.imdb.com/title/tt0348150/?ref_=fn_t...</td>\n",
       "      <td>2367.0</td>\n",
       "      <td>English</td>\n",
       "      <td>USA</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>209000000.0</td>\n",
       "      <td>2006.0</td>\n",
       "      <td>10000.0</td>\n",
       "      <td>6.1</td>\n",
       "      <td>2.35</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                          color   director_name  \\\n",
       "movie_title                                                       \n",
       "Avatar                                    Color   James Cameron   \n",
       "Pirates of the Caribbean: At World's End  Color  Gore Verbinski   \n",
       "Spider-Man 3                              Color       Sam Raimi   \n",
       "Harry Potter and the Half-Blood Prince    Color     David Yates   \n",
       "Superman Returns                          Color    Bryan Singer   \n",
       "\n",
       "                                          num_critic_for_reviews  duration  \\\n",
       "movie_title                                                                  \n",
       "Avatar                                                     723.0     178.0   \n",
       "Pirates of the Caribbean: At World's End                   302.0     169.0   \n",
       "Spider-Man 3                                               392.0     156.0   \n",
       "Harry Potter and the Half-Blood Prince                     375.0     153.0   \n",
       "Superman Returns                                           434.0     169.0   \n",
       "\n",
       "                                          director_facebook_likes  \\\n",
       "movie_title                                                         \n",
       "Avatar                                                        0.0   \n",
       "Pirates of the Caribbean: At World's End                    563.0   \n",
       "Spider-Man 3                                                  0.0   \n",
       "Harry Potter and the Half-Blood Prince                      282.0   \n",
       "Superman Returns                                              0.0   \n",
       "\n",
       "                                          actor_3_facebook_likes  \\\n",
       "movie_title                                                        \n",
       "Avatar                                                     855.0   \n",
       "Pirates of the Caribbean: At World's End                  1000.0   \n",
       "Spider-Man 3                                              4000.0   \n",
       "Harry Potter and the Half-Blood Prince                   10000.0   \n",
       "Superman Returns                                           903.0   \n",
       "\n",
       "                                              actor_2_name  \\\n",
       "movie_title                                                  \n",
       "Avatar                                    Joel David Moore   \n",
       "Pirates of the Caribbean: At World's End     Orlando Bloom   \n",
       "Spider-Man 3                                  James Franco   \n",
       "Harry Potter and the Half-Blood Prince    Daniel Radcliffe   \n",
       "Superman Returns                             Marlon Brando   \n",
       "\n",
       "                                          actor_1_facebook_likes        gross  \\\n",
       "movie_title                                                                     \n",
       "Avatar                                                    1000.0  760505847.0   \n",
       "Pirates of the Caribbean: At World's End                 40000.0  309404152.0   \n",
       "Spider-Man 3                                             24000.0  336530303.0   \n",
       "Harry Potter and the Half-Blood Prince                   25000.0  301956980.0   \n",
       "Superman Returns                                         18000.0  200069408.0   \n",
       "\n",
       "                                                                    genres  \\\n",
       "movie_title                                                                  \n",
       "Avatar                                     Action|Adventure|Fantasy|Sci-Fi   \n",
       "Pirates of the Caribbean: At World's End          Action|Adventure|Fantasy   \n",
       "Spider-Man 3                                      Action|Adventure|Romance   \n",
       "Harry Potter and the Half-Blood Prince    Adventure|Family|Fantasy|Mystery   \n",
       "Superman Returns                                   Action|Adventure|Sci-Fi   \n",
       "\n",
       "                                          actor_1_name  num_voted_users  \\\n",
       "movie_title                                                               \n",
       "Avatar                                     CCH Pounder         886204.0   \n",
       "Pirates of the Caribbean: At World's End   Johnny Depp         471220.0   \n",
       "Spider-Man 3                              J.K. Simmons         383056.0   \n",
       "Harry Potter and the Half-Blood Prince    Alan Rickman         321795.0   \n",
       "Superman Returns                          Kevin Spacey         240396.0   \n",
       "\n",
       "                                          cast_total_facebook_likes  \\\n",
       "movie_title                                                           \n",
       "Avatar                                                       4834.0   \n",
       "Pirates of the Caribbean: At World's End                    48350.0   \n",
       "Spider-Man 3                                                46055.0   \n",
       "Harry Potter and the Half-Blood Prince                      58753.0   \n",
       "Superman Returns                                            29991.0   \n",
       "\n",
       "                                            actor_3_name  \\\n",
       "movie_title                                                \n",
       "Avatar                                         Wes Studi   \n",
       "Pirates of the Caribbean: At World's End  Jack Davenport   \n",
       "Spider-Man 3                               Kirsten Dunst   \n",
       "Harry Potter and the Half-Blood Prince      Rupert Grint   \n",
       "Superman Returns                          Frank Langella   \n",
       "\n",
       "                                          facenumber_in_poster  \\\n",
       "movie_title                                                      \n",
       "Avatar                                                     0.0   \n",
       "Pirates of the Caribbean: At World's End                   0.0   \n",
       "Spider-Man 3                                               0.0   \n",
       "Harry Potter and the Half-Blood Prince                     3.0   \n",
       "Superman Returns                                           0.0   \n",
       "\n",
       "                                                                              plot_keywords  \\\n",
       "movie_title                                                                                   \n",
       "Avatar                                               avatar|future|marine|native|paraplegic   \n",
       "Pirates of the Caribbean: At World's End  goddess|marriage ceremony|marriage proposal|pi...   \n",
       "Spider-Man 3                                      sandman|spider man|symbiote|venom|villain   \n",
       "Harry Potter and the Half-Blood Prince                     blood|book|love|potion|professor   \n",
       "Superman Returns                          crystal|epic|lex luthor|lois lane|return to earth   \n",
       "\n",
       "                                                                            movie_imdb_link  \\\n",
       "movie_title                                                                                   \n",
       "Avatar                                    http://www.imdb.com/title/tt0499549/?ref_=fn_t...   \n",
       "Pirates of the Caribbean: At World's End  http://www.imdb.com/title/tt0449088/?ref_=fn_t...   \n",
       "Spider-Man 3                              http://www.imdb.com/title/tt0413300/?ref_=fn_t...   \n",
       "Harry Potter and the Half-Blood Prince    http://www.imdb.com/title/tt0417741/?ref_=fn_t...   \n",
       "Superman Returns                          http://www.imdb.com/title/tt0348150/?ref_=fn_t...   \n",
       "\n",
       "                                          num_user_for_reviews language  \\\n",
       "movie_title                                                               \n",
       "Avatar                                                  3054.0  English   \n",
       "Pirates of the Caribbean: At World's End                1238.0  English   \n",
       "Spider-Man 3                                            1902.0  English   \n",
       "Harry Potter and the Half-Blood Prince                   973.0  English   \n",
       "Superman Returns                                        2367.0  English   \n",
       "\n",
       "                                         country content_rating       budget  \\\n",
       "movie_title                                                                    \n",
       "Avatar                                       USA          PG-13  237000000.0   \n",
       "Pirates of the Caribbean: At World's End     USA          PG-13  300000000.0   \n",
       "Spider-Man 3                                 USA          PG-13  258000000.0   \n",
       "Harry Potter and the Half-Blood Prince        UK             PG  250000000.0   \n",
       "Superman Returns                             USA          PG-13  209000000.0   \n",
       "\n",
       "                                          title_year  actor_2_facebook_likes  \\\n",
       "movie_title                                                                    \n",
       "Avatar                                        2009.0                   936.0   \n",
       "Pirates of the Caribbean: At World's End      2007.0                  5000.0   \n",
       "Spider-Man 3                                  2007.0                 11000.0   \n",
       "Harry Potter and the Half-Blood Prince        2009.0                 11000.0   \n",
       "Superman Returns                              2006.0                 10000.0   \n",
       "\n",
       "                                          imdb_score  aspect_ratio  \\\n",
       "movie_title                                                          \n",
       "Avatar                                           7.9          1.78   \n",
       "Pirates of the Caribbean: At World's End         7.1          2.35   \n",
       "Spider-Man 3                                     6.2          2.35   \n",
       "Harry Potter and the Half-Blood Prince           7.5          2.35   \n",
       "Superman Returns                                 6.1          2.35   \n",
       "\n",
       "                                          movie_facebook_likes  \n",
       "movie_title                                                     \n",
       "Avatar                                                 33000.0  \n",
       "Pirates of the Caribbean: At World's End                   0.0  \n",
       "Spider-Man 3                                               0.0  \n",
       "Harry Potter and the Half-Blood Prince                 10000.0  \n",
       "Superman Returns                                           0.0  "
      ]
     },
     "execution_count": 82,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "movie_mask = movie.mask(criteria).dropna(how='all') # 任意一个元素为空值，这行就不要。\n",
    "movie_mask.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>color</th>\n",
       "      <th>director_name</th>\n",
       "      <th>num_critic_for_reviews</th>\n",
       "      <th>duration</th>\n",
       "      <th>director_facebook_likes</th>\n",
       "      <th>actor_3_facebook_likes</th>\n",
       "      <th>actor_2_name</th>\n",
       "      <th>actor_1_facebook_likes</th>\n",
       "      <th>gross</th>\n",
       "      <th>genres</th>\n",
       "      <th>actor_1_name</th>\n",
       "      <th>num_voted_users</th>\n",
       "      <th>cast_total_facebook_likes</th>\n",
       "      <th>actor_3_name</th>\n",
       "      <th>facenumber_in_poster</th>\n",
       "      <th>plot_keywords</th>\n",
       "      <th>movie_imdb_link</th>\n",
       "      <th>num_user_for_reviews</th>\n",
       "      <th>language</th>\n",
       "      <th>country</th>\n",
       "      <th>content_rating</th>\n",
       "      <th>budget</th>\n",
       "      <th>title_year</th>\n",
       "      <th>actor_2_facebook_likes</th>\n",
       "      <th>imdb_score</th>\n",
       "      <th>aspect_ratio</th>\n",
       "      <th>movie_facebook_likes</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>movie_title</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Avatar</th>\n",
       "      <td>Color</td>\n",
       "      <td>James Cameron</td>\n",
       "      <td>723.0</td>\n",
       "      <td>178.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>855.0</td>\n",
       "      <td>Joel David Moore</td>\n",
       "      <td>1000.0</td>\n",
       "      <td>760505847.0</td>\n",
       "      <td>Action|Adventure|Fantasy|Sci-Fi</td>\n",
       "      <td>CCH Pounder</td>\n",
       "      <td>886204</td>\n",
       "      <td>4834</td>\n",
       "      <td>Wes Studi</td>\n",
       "      <td>0.0</td>\n",
       "      <td>avatar|future|marine|native|paraplegic</td>\n",
       "      <td>http://www.imdb.com/title/tt0499549/?ref_=fn_t...</td>\n",
       "      <td>3054.0</td>\n",
       "      <td>English</td>\n",
       "      <td>USA</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>237000000.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>936.0</td>\n",
       "      <td>7.9</td>\n",
       "      <td>1.78</td>\n",
       "      <td>33000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Pirates of the Caribbean: At World's End</th>\n",
       "      <td>Color</td>\n",
       "      <td>Gore Verbinski</td>\n",
       "      <td>302.0</td>\n",
       "      <td>169.0</td>\n",
       "      <td>563.0</td>\n",
       "      <td>1000.0</td>\n",
       "      <td>Orlando Bloom</td>\n",
       "      <td>40000.0</td>\n",
       "      <td>309404152.0</td>\n",
       "      <td>Action|Adventure|Fantasy</td>\n",
       "      <td>Johnny Depp</td>\n",
       "      <td>471220</td>\n",
       "      <td>48350</td>\n",
       "      <td>Jack Davenport</td>\n",
       "      <td>0.0</td>\n",
       "      <td>goddess|marriage ceremony|marriage proposal|pi...</td>\n",
       "      <td>http://www.imdb.com/title/tt0449088/?ref_=fn_t...</td>\n",
       "      <td>1238.0</td>\n",
       "      <td>English</td>\n",
       "      <td>USA</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>300000000.0</td>\n",
       "      <td>2007.0</td>\n",
       "      <td>5000.0</td>\n",
       "      <td>7.1</td>\n",
       "      <td>2.35</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Spider-Man 3</th>\n",
       "      <td>Color</td>\n",
       "      <td>Sam Raimi</td>\n",
       "      <td>392.0</td>\n",
       "      <td>156.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4000.0</td>\n",
       "      <td>James Franco</td>\n",
       "      <td>24000.0</td>\n",
       "      <td>336530303.0</td>\n",
       "      <td>Action|Adventure|Romance</td>\n",
       "      <td>J.K. Simmons</td>\n",
       "      <td>383056</td>\n",
       "      <td>46055</td>\n",
       "      <td>Kirsten Dunst</td>\n",
       "      <td>0.0</td>\n",
       "      <td>sandman|spider man|symbiote|venom|villain</td>\n",
       "      <td>http://www.imdb.com/title/tt0413300/?ref_=fn_t...</td>\n",
       "      <td>1902.0</td>\n",
       "      <td>English</td>\n",
       "      <td>USA</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>258000000.0</td>\n",
       "      <td>2007.0</td>\n",
       "      <td>11000.0</td>\n",
       "      <td>6.2</td>\n",
       "      <td>2.35</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Harry Potter and the Half-Blood Prince</th>\n",
       "      <td>Color</td>\n",
       "      <td>David Yates</td>\n",
       "      <td>375.0</td>\n",
       "      <td>153.0</td>\n",
       "      <td>282.0</td>\n",
       "      <td>10000.0</td>\n",
       "      <td>Daniel Radcliffe</td>\n",
       "      <td>25000.0</td>\n",
       "      <td>301956980.0</td>\n",
       "      <td>Adventure|Family|Fantasy|Mystery</td>\n",
       "      <td>Alan Rickman</td>\n",
       "      <td>321795</td>\n",
       "      <td>58753</td>\n",
       "      <td>Rupert Grint</td>\n",
       "      <td>3.0</td>\n",
       "      <td>blood|book|love|potion|professor</td>\n",
       "      <td>http://www.imdb.com/title/tt0417741/?ref_=fn_t...</td>\n",
       "      <td>973.0</td>\n",
       "      <td>English</td>\n",
       "      <td>UK</td>\n",
       "      <td>PG</td>\n",
       "      <td>250000000.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>11000.0</td>\n",
       "      <td>7.5</td>\n",
       "      <td>2.35</td>\n",
       "      <td>10000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Superman Returns</th>\n",
       "      <td>Color</td>\n",
       "      <td>Bryan Singer</td>\n",
       "      <td>434.0</td>\n",
       "      <td>169.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>903.0</td>\n",
       "      <td>Marlon Brando</td>\n",
       "      <td>18000.0</td>\n",
       "      <td>200069408.0</td>\n",
       "      <td>Action|Adventure|Sci-Fi</td>\n",
       "      <td>Kevin Spacey</td>\n",
       "      <td>240396</td>\n",
       "      <td>29991</td>\n",
       "      <td>Frank Langella</td>\n",
       "      <td>0.0</td>\n",
       "      <td>crystal|epic|lex luthor|lois lane|return to earth</td>\n",
       "      <td>http://www.imdb.com/title/tt0348150/?ref_=fn_t...</td>\n",
       "      <td>2367.0</td>\n",
       "      <td>English</td>\n",
       "      <td>USA</td>\n",
       "      <td>PG-13</td>\n",
       "      <td>209000000.0</td>\n",
       "      <td>2006.0</td>\n",
       "      <td>10000.0</td>\n",
       "      <td>6.1</td>\n",
       "      <td>2.35</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                          color   director_name  \\\n",
       "movie_title                                                       \n",
       "Avatar                                    Color   James Cameron   \n",
       "Pirates of the Caribbean: At World's End  Color  Gore Verbinski   \n",
       "Spider-Man 3                              Color       Sam Raimi   \n",
       "Harry Potter and the Half-Blood Prince    Color     David Yates   \n",
       "Superman Returns                          Color    Bryan Singer   \n",
       "\n",
       "                                          num_critic_for_reviews  duration  \\\n",
       "movie_title                                                                  \n",
       "Avatar                                                     723.0     178.0   \n",
       "Pirates of the Caribbean: At World's End                   302.0     169.0   \n",
       "Spider-Man 3                                               392.0     156.0   \n",
       "Harry Potter and the Half-Blood Prince                     375.0     153.0   \n",
       "Superman Returns                                           434.0     169.0   \n",
       "\n",
       "                                          director_facebook_likes  \\\n",
       "movie_title                                                         \n",
       "Avatar                                                        0.0   \n",
       "Pirates of the Caribbean: At World's End                    563.0   \n",
       "Spider-Man 3                                                  0.0   \n",
       "Harry Potter and the Half-Blood Prince                      282.0   \n",
       "Superman Returns                                              0.0   \n",
       "\n",
       "                                          actor_3_facebook_likes  \\\n",
       "movie_title                                                        \n",
       "Avatar                                                     855.0   \n",
       "Pirates of the Caribbean: At World's End                  1000.0   \n",
       "Spider-Man 3                                              4000.0   \n",
       "Harry Potter and the Half-Blood Prince                   10000.0   \n",
       "Superman Returns                                           903.0   \n",
       "\n",
       "                                              actor_2_name  \\\n",
       "movie_title                                                  \n",
       "Avatar                                    Joel David Moore   \n",
       "Pirates of the Caribbean: At World's End     Orlando Bloom   \n",
       "Spider-Man 3                                  James Franco   \n",
       "Harry Potter and the Half-Blood Prince    Daniel Radcliffe   \n",
       "Superman Returns                             Marlon Brando   \n",
       "\n",
       "                                          actor_1_facebook_likes        gross  \\\n",
       "movie_title                                                                     \n",
       "Avatar                                                    1000.0  760505847.0   \n",
       "Pirates of the Caribbean: At World's End                 40000.0  309404152.0   \n",
       "Spider-Man 3                                             24000.0  336530303.0   \n",
       "Harry Potter and the Half-Blood Prince                   25000.0  301956980.0   \n",
       "Superman Returns                                         18000.0  200069408.0   \n",
       "\n",
       "                                                                    genres  \\\n",
       "movie_title                                                                  \n",
       "Avatar                                     Action|Adventure|Fantasy|Sci-Fi   \n",
       "Pirates of the Caribbean: At World's End          Action|Adventure|Fantasy   \n",
       "Spider-Man 3                                      Action|Adventure|Romance   \n",
       "Harry Potter and the Half-Blood Prince    Adventure|Family|Fantasy|Mystery   \n",
       "Superman Returns                                   Action|Adventure|Sci-Fi   \n",
       "\n",
       "                                          actor_1_name  num_voted_users  \\\n",
       "movie_title                                                               \n",
       "Avatar                                     CCH Pounder           886204   \n",
       "Pirates of the Caribbean: At World's End   Johnny Depp           471220   \n",
       "Spider-Man 3                              J.K. Simmons           383056   \n",
       "Harry Potter and the Half-Blood Prince    Alan Rickman           321795   \n",
       "Superman Returns                          Kevin Spacey           240396   \n",
       "\n",
       "                                          cast_total_facebook_likes  \\\n",
       "movie_title                                                           \n",
       "Avatar                                                         4834   \n",
       "Pirates of the Caribbean: At World's End                      48350   \n",
       "Spider-Man 3                                                  46055   \n",
       "Harry Potter and the Half-Blood Prince                        58753   \n",
       "Superman Returns                                              29991   \n",
       "\n",
       "                                            actor_3_name  \\\n",
       "movie_title                                                \n",
       "Avatar                                         Wes Studi   \n",
       "Pirates of the Caribbean: At World's End  Jack Davenport   \n",
       "Spider-Man 3                               Kirsten Dunst   \n",
       "Harry Potter and the Half-Blood Prince      Rupert Grint   \n",
       "Superman Returns                          Frank Langella   \n",
       "\n",
       "                                          facenumber_in_poster  \\\n",
       "movie_title                                                      \n",
       "Avatar                                                     0.0   \n",
       "Pirates of the Caribbean: At World's End                   0.0   \n",
       "Spider-Man 3                                               0.0   \n",
       "Harry Potter and the Half-Blood Prince                     3.0   \n",
       "Superman Returns                                           0.0   \n",
       "\n",
       "                                                                              plot_keywords  \\\n",
       "movie_title                                                                                   \n",
       "Avatar                                               avatar|future|marine|native|paraplegic   \n",
       "Pirates of the Caribbean: At World's End  goddess|marriage ceremony|marriage proposal|pi...   \n",
       "Spider-Man 3                                      sandman|spider man|symbiote|venom|villain   \n",
       "Harry Potter and the Half-Blood Prince                     blood|book|love|potion|professor   \n",
       "Superman Returns                          crystal|epic|lex luthor|lois lane|return to earth   \n",
       "\n",
       "                                                                            movie_imdb_link  \\\n",
       "movie_title                                                                                   \n",
       "Avatar                                    http://www.imdb.com/title/tt0499549/?ref_=fn_t...   \n",
       "Pirates of the Caribbean: At World's End  http://www.imdb.com/title/tt0449088/?ref_=fn_t...   \n",
       "Spider-Man 3                              http://www.imdb.com/title/tt0413300/?ref_=fn_t...   \n",
       "Harry Potter and the Half-Blood Prince    http://www.imdb.com/title/tt0417741/?ref_=fn_t...   \n",
       "Superman Returns                          http://www.imdb.com/title/tt0348150/?ref_=fn_t...   \n",
       "\n",
       "                                          num_user_for_reviews language  \\\n",
       "movie_title                                                               \n",
       "Avatar                                                  3054.0  English   \n",
       "Pirates of the Caribbean: At World's End                1238.0  English   \n",
       "Spider-Man 3                                            1902.0  English   \n",
       "Harry Potter and the Half-Blood Prince                   973.0  English   \n",
       "Superman Returns                                        2367.0  English   \n",
       "\n",
       "                                         country content_rating       budget  \\\n",
       "movie_title                                                                    \n",
       "Avatar                                       USA          PG-13  237000000.0   \n",
       "Pirates of the Caribbean: At World's End     USA          PG-13  300000000.0   \n",
       "Spider-Man 3                                 USA          PG-13  258000000.0   \n",
       "Harry Potter and the Half-Blood Prince        UK             PG  250000000.0   \n",
       "Superman Returns                             USA          PG-13  209000000.0   \n",
       "\n",
       "                                          title_year  actor_2_facebook_likes  \\\n",
       "movie_title                                                                    \n",
       "Avatar                                        2009.0                   936.0   \n",
       "Pirates of the Caribbean: At World's End      2007.0                  5000.0   \n",
       "Spider-Man 3                                  2007.0                 11000.0   \n",
       "Harry Potter and the Half-Blood Prince        2009.0                 11000.0   \n",
       "Superman Returns                              2006.0                 10000.0   \n",
       "\n",
       "                                          imdb_score  aspect_ratio  \\\n",
       "movie_title                                                          \n",
       "Avatar                                           7.9          1.78   \n",
       "Pirates of the Caribbean: At World's End         7.1          2.35   \n",
       "Spider-Man 3                                     6.2          2.35   \n",
       "Harry Potter and the Half-Blood Prince           7.5          2.35   \n",
       "Superman Returns                                 6.1          2.35   \n",
       "\n",
       "                                          movie_facebook_likes  \n",
       "movie_title                                                     \n",
       "Avatar                                                   33000  \n",
       "Pirates of the Caribbean: At World's End                     0  \n",
       "Spider-Man 3                                                 0  \n",
       "Harry Potter and the Half-Blood Prince                   10000  \n",
       "Superman Returns                                             0  "
      ]
     },
     "execution_count": 83,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "movie_boolean = movie[movie['title_year'] < 2010]\n",
    "movie_boolean.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 84,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "movie_mask.equals(movie_boolean) # 为什么是False看后面的比较，有列数据类型不一样。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 85,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "movie_mask.shape == movie_boolean.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "color                         True\n",
       "director_name                 True\n",
       "num_critic_for_reviews        True\n",
       "duration                      True\n",
       "director_facebook_likes       True\n",
       "actor_3_facebook_likes        True\n",
       "actor_2_name                  True\n",
       "actor_1_facebook_likes        True\n",
       "gross                         True\n",
       "genres                        True\n",
       "actor_1_name                  True\n",
       "num_voted_users              False\n",
       "cast_total_facebook_likes    False\n",
       "actor_3_name                  True\n",
       "facenumber_in_poster          True\n",
       "plot_keywords                 True\n",
       "movie_imdb_link               True\n",
       "num_user_for_reviews          True\n",
       "language                      True\n",
       "country                       True\n",
       "content_rating                True\n",
       "budget                        True\n",
       "title_year                    True\n",
       "actor_2_facebook_likes        True\n",
       "imdb_score                    True\n",
       "aspect_ratio                  True\n",
       "movie_facebook_likes         False\n",
       "dtype: bool"
      ]
     },
     "execution_count": 86,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# num_voted_users原来是int64，但是mask后，可能因为有空值要处理，就变成了float64。\n",
    "movie_mask.dtypes == movie_boolean.dtypes # 每一列的数据类型比较"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pandas.testing import assert_frame_equal\n",
    "assert_frame_equal(movie_boolean, movie_mask, check_dtype=False) # 只比较值，不比较类型。如果check_dtype=True就会抛出异常。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "26.6 ms ± 737 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n"
     ]
    }
   ],
   "source": [
    "%timeit movie.mask(criteria).dropna(how='all')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "845 µs ± 28.1 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n"
     ]
    }
   ],
   "source": [
    "%timeit movie[movie['title_year'] < 2010]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 使用布尔，下标或名字索引定位元素"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {},
   "outputs": [],
   "source": [
    "movie = pd.read_csv('data/movie.csv', index_col='movie_title')\n",
    "c1 = movie['content_rating'] == 'G'\n",
    "c2 = movie['imdb_score'] < 4\n",
    "criteria = c1 & c2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>color</th>\n",
       "      <th>director_name</th>\n",
       "      <th>num_critic_for_reviews</th>\n",
       "      <th>duration</th>\n",
       "      <th>director_facebook_likes</th>\n",
       "      <th>actor_3_facebook_likes</th>\n",
       "      <th>actor_2_name</th>\n",
       "      <th>actor_1_facebook_likes</th>\n",
       "      <th>gross</th>\n",
       "      <th>genres</th>\n",
       "      <th>actor_1_name</th>\n",
       "      <th>num_voted_users</th>\n",
       "      <th>cast_total_facebook_likes</th>\n",
       "      <th>actor_3_name</th>\n",
       "      <th>facenumber_in_poster</th>\n",
       "      <th>plot_keywords</th>\n",
       "      <th>movie_imdb_link</th>\n",
       "      <th>num_user_for_reviews</th>\n",
       "      <th>language</th>\n",
       "      <th>country</th>\n",
       "      <th>content_rating</th>\n",
       "      <th>budget</th>\n",
       "      <th>title_year</th>\n",
       "      <th>actor_2_facebook_likes</th>\n",
       "      <th>imdb_score</th>\n",
       "      <th>aspect_ratio</th>\n",
       "      <th>movie_facebook_likes</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>movie_title</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>The True Story of Puss'N Boots</th>\n",
       "      <td>Color</td>\n",
       "      <td>Jérôme Deschamps</td>\n",
       "      <td>4.0</td>\n",
       "      <td>80.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>André Wilms</td>\n",
       "      <td>44.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Adventure|Animation|Comedy</td>\n",
       "      <td>Yolande Moreau</td>\n",
       "      <td>753</td>\n",
       "      <td>53</td>\n",
       "      <td>Jérôme Deschamps</td>\n",
       "      <td>0.0</td>\n",
       "      <td>cartoon cat|cat|character name in title|puss i...</td>\n",
       "      <td>http://www.imdb.com/title/tt1239462/?ref_=fn_t...</td>\n",
       "      <td>24.0</td>\n",
       "      <td>English</td>\n",
       "      <td>France</td>\n",
       "      <td>G</td>\n",
       "      <td>25000000.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>2.9</td>\n",
       "      <td>NaN</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Doogal</th>\n",
       "      <td>Color</td>\n",
       "      <td>Dave Borthwick</td>\n",
       "      <td>31.0</td>\n",
       "      <td>77.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>593.0</td>\n",
       "      <td>Kylie Minogue</td>\n",
       "      <td>787.0</td>\n",
       "      <td>7382993.0</td>\n",
       "      <td>Adventure|Animation|Comedy|Family|Fantasy</td>\n",
       "      <td>Jimmy Fallon</td>\n",
       "      <td>3851</td>\n",
       "      <td>2185</td>\n",
       "      <td>Jon Stewart</td>\n",
       "      <td>0.0</td>\n",
       "      <td>diamond|lava|magic|mountain|sorcerer</td>\n",
       "      <td>http://www.imdb.com/title/tt0763304/?ref_=fn_t...</td>\n",
       "      <td>114.0</td>\n",
       "      <td>English</td>\n",
       "      <td>USA</td>\n",
       "      <td>G</td>\n",
       "      <td>20000000.0</td>\n",
       "      <td>2006.0</td>\n",
       "      <td>690.0</td>\n",
       "      <td>2.8</td>\n",
       "      <td>1.85</td>\n",
       "      <td>346</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Thomas and the Magic Railroad</th>\n",
       "      <td>Color</td>\n",
       "      <td>Britt Allcroft</td>\n",
       "      <td>47.0</td>\n",
       "      <td>85.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>402.0</td>\n",
       "      <td>Colm Feore</td>\n",
       "      <td>1000.0</td>\n",
       "      <td>15911333.0</td>\n",
       "      <td>Adventure|Comedy|Drama|Family|Fantasy</td>\n",
       "      <td>Mara Wilson</td>\n",
       "      <td>2855</td>\n",
       "      <td>2429</td>\n",
       "      <td>Peter Fonda</td>\n",
       "      <td>1.0</td>\n",
       "      <td>locomotive|magic|mountain|railroad|steam locom...</td>\n",
       "      <td>http://www.imdb.com/title/tt0205461/?ref_=fn_t...</td>\n",
       "      <td>119.0</td>\n",
       "      <td>English</td>\n",
       "      <td>UK</td>\n",
       "      <td>G</td>\n",
       "      <td>19000000.0</td>\n",
       "      <td>2000.0</td>\n",
       "      <td>539.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.85</td>\n",
       "      <td>663</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Barney's Great Adventure</th>\n",
       "      <td>Color</td>\n",
       "      <td>Steve Gomer</td>\n",
       "      <td>24.0</td>\n",
       "      <td>76.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>47.0</td>\n",
       "      <td>Kyla Pratt</td>\n",
       "      <td>595.0</td>\n",
       "      <td>11144518.0</td>\n",
       "      <td>Adventure|Family</td>\n",
       "      <td>Trevor Morgan</td>\n",
       "      <td>2724</td>\n",
       "      <td>1139</td>\n",
       "      <td>Shirley Douglas</td>\n",
       "      <td>0.0</td>\n",
       "      <td>apostrophe in title|critically bashed|hit on t...</td>\n",
       "      <td>http://www.imdb.com/title/tt0120598/?ref_=fn_t...</td>\n",
       "      <td>53.0</td>\n",
       "      <td>English</td>\n",
       "      <td>Canada</td>\n",
       "      <td>G</td>\n",
       "      <td>15000000.0</td>\n",
       "      <td>1998.0</td>\n",
       "      <td>417.0</td>\n",
       "      <td>2.8</td>\n",
       "      <td>1.85</td>\n",
       "      <td>436</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Justin Bieber: Never Say Never</th>\n",
       "      <td>Color</td>\n",
       "      <td>Jon M. Chu</td>\n",
       "      <td>84.0</td>\n",
       "      <td>115.0</td>\n",
       "      <td>209.0</td>\n",
       "      <td>41.0</td>\n",
       "      <td>Sean Kingston</td>\n",
       "      <td>569.0</td>\n",
       "      <td>73000942.0</td>\n",
       "      <td>Documentary|Music</td>\n",
       "      <td>Usher Raymond</td>\n",
       "      <td>74351</td>\n",
       "      <td>714</td>\n",
       "      <td>Boys II Men</td>\n",
       "      <td>1.0</td>\n",
       "      <td>boyhood friend|manager|plasma tv|prodigy|star</td>\n",
       "      <td>http://www.imdb.com/title/tt1702443/?ref_=fn_t...</td>\n",
       "      <td>233.0</td>\n",
       "      <td>English</td>\n",
       "      <td>USA</td>\n",
       "      <td>G</td>\n",
       "      <td>13000000.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>69.0</td>\n",
       "      <td>1.6</td>\n",
       "      <td>1.85</td>\n",
       "      <td>62000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                color     director_name  \\\n",
       "movie_title                                               \n",
       "The True Story of Puss'N Boots  Color  Jérôme Deschamps   \n",
       "Doogal                          Color    Dave Borthwick   \n",
       "Thomas and the Magic Railroad   Color    Britt Allcroft   \n",
       "Barney's Great Adventure        Color       Steve Gomer   \n",
       "Justin Bieber: Never Say Never  Color        Jon M. Chu   \n",
       "\n",
       "                                num_critic_for_reviews  duration  \\\n",
       "movie_title                                                        \n",
       "The True Story of Puss'N Boots                     4.0      80.0   \n",
       "Doogal                                            31.0      77.0   \n",
       "Thomas and the Magic Railroad                     47.0      85.0   \n",
       "Barney's Great Adventure                          24.0      76.0   \n",
       "Justin Bieber: Never Say Never                    84.0     115.0   \n",
       "\n",
       "                                director_facebook_likes  \\\n",
       "movie_title                                               \n",
       "The True Story of Puss'N Boots                      0.0   \n",
       "Doogal                                              3.0   \n",
       "Thomas and the Magic Railroad                       2.0   \n",
       "Barney's Great Adventure                            9.0   \n",
       "Justin Bieber: Never Say Never                    209.0   \n",
       "\n",
       "                                actor_3_facebook_likes   actor_2_name  \\\n",
       "movie_title                                                             \n",
       "The True Story of Puss'N Boots                     0.0    André Wilms   \n",
       "Doogal                                           593.0  Kylie Minogue   \n",
       "Thomas and the Magic Railroad                    402.0     Colm Feore   \n",
       "Barney's Great Adventure                          47.0     Kyla Pratt   \n",
       "Justin Bieber: Never Say Never                    41.0  Sean Kingston   \n",
       "\n",
       "                                actor_1_facebook_likes       gross  \\\n",
       "movie_title                                                          \n",
       "The True Story of Puss'N Boots                    44.0         NaN   \n",
       "Doogal                                           787.0   7382993.0   \n",
       "Thomas and the Magic Railroad                   1000.0  15911333.0   \n",
       "Barney's Great Adventure                         595.0  11144518.0   \n",
       "Justin Bieber: Never Say Never                   569.0  73000942.0   \n",
       "\n",
       "                                                                   genres  \\\n",
       "movie_title                                                                 \n",
       "The True Story of Puss'N Boots                 Adventure|Animation|Comedy   \n",
       "Doogal                          Adventure|Animation|Comedy|Family|Fantasy   \n",
       "Thomas and the Magic Railroad       Adventure|Comedy|Drama|Family|Fantasy   \n",
       "Barney's Great Adventure                                 Adventure|Family   \n",
       "Justin Bieber: Never Say Never                          Documentary|Music   \n",
       "\n",
       "                                  actor_1_name  num_voted_users  \\\n",
       "movie_title                                                       \n",
       "The True Story of Puss'N Boots  Yolande Moreau              753   \n",
       "Doogal                            Jimmy Fallon             3851   \n",
       "Thomas and the Magic Railroad      Mara Wilson             2855   \n",
       "Barney's Great Adventure         Trevor Morgan             2724   \n",
       "Justin Bieber: Never Say Never   Usher Raymond            74351   \n",
       "\n",
       "                                cast_total_facebook_likes      actor_3_name  \\\n",
       "movie_title                                                                   \n",
       "The True Story of Puss'N Boots                         53  Jérôme Deschamps   \n",
       "Doogal                                               2185       Jon Stewart   \n",
       "Thomas and the Magic Railroad                        2429       Peter Fonda   \n",
       "Barney's Great Adventure                             1139   Shirley Douglas   \n",
       "Justin Bieber: Never Say Never                        714       Boys II Men   \n",
       "\n",
       "                                facenumber_in_poster  \\\n",
       "movie_title                                            \n",
       "The True Story of Puss'N Boots                   0.0   \n",
       "Doogal                                           0.0   \n",
       "Thomas and the Magic Railroad                    1.0   \n",
       "Barney's Great Adventure                         0.0   \n",
       "Justin Bieber: Never Say Never                   1.0   \n",
       "\n",
       "                                                                    plot_keywords  \\\n",
       "movie_title                                                                         \n",
       "The True Story of Puss'N Boots  cartoon cat|cat|character name in title|puss i...   \n",
       "Doogal                                       diamond|lava|magic|mountain|sorcerer   \n",
       "Thomas and the Magic Railroad   locomotive|magic|mountain|railroad|steam locom...   \n",
       "Barney's Great Adventure        apostrophe in title|critically bashed|hit on t...   \n",
       "Justin Bieber: Never Say Never      boyhood friend|manager|plasma tv|prodigy|star   \n",
       "\n",
       "                                                                  movie_imdb_link  \\\n",
       "movie_title                                                                         \n",
       "The True Story of Puss'N Boots  http://www.imdb.com/title/tt1239462/?ref_=fn_t...   \n",
       "Doogal                          http://www.imdb.com/title/tt0763304/?ref_=fn_t...   \n",
       "Thomas and the Magic Railroad   http://www.imdb.com/title/tt0205461/?ref_=fn_t...   \n",
       "Barney's Great Adventure        http://www.imdb.com/title/tt0120598/?ref_=fn_t...   \n",
       "Justin Bieber: Never Say Never  http://www.imdb.com/title/tt1702443/?ref_=fn_t...   \n",
       "\n",
       "                                num_user_for_reviews language country  \\\n",
       "movie_title                                                             \n",
       "The True Story of Puss'N Boots                  24.0  English  France   \n",
       "Doogal                                         114.0  English     USA   \n",
       "Thomas and the Magic Railroad                  119.0  English      UK   \n",
       "Barney's Great Adventure                        53.0  English  Canada   \n",
       "Justin Bieber: Never Say Never                 233.0  English     USA   \n",
       "\n",
       "                               content_rating      budget  title_year  \\\n",
       "movie_title                                                             \n",
       "The True Story of Puss'N Boots              G  25000000.0      2009.0   \n",
       "Doogal                                      G  20000000.0      2006.0   \n",
       "Thomas and the Magic Railroad               G  19000000.0      2000.0   \n",
       "Barney's Great Adventure                    G  15000000.0      1998.0   \n",
       "Justin Bieber: Never Say Never              G  13000000.0      2011.0   \n",
       "\n",
       "                                actor_2_facebook_likes  imdb_score  \\\n",
       "movie_title                                                          \n",
       "The True Story of Puss'N Boots                     9.0         2.9   \n",
       "Doogal                                           690.0         2.8   \n",
       "Thomas and the Magic Railroad                    539.0         3.6   \n",
       "Barney's Great Adventure                         417.0         2.8   \n",
       "Justin Bieber: Never Say Never                    69.0         1.6   \n",
       "\n",
       "                                aspect_ratio  movie_facebook_likes  \n",
       "movie_title                                                         \n",
       "The True Story of Puss'N Boots           NaN                    90  \n",
       "Doogal                                  1.85                   346  \n",
       "Thomas and the Magic Railroad           1.85                   663  \n",
       "Barney's Great Adventure                1.85                   436  \n",
       "Justin Bieber: Never Say Never          1.85                 62000  "
      ]
     },
     "execution_count": 91,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "movie_loc = movie.loc[criteria] # 根据要求筛选行\n",
    "movie_loc.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 92,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "movie_loc.equals(movie[criteria])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "iLocation based boolean indexing cannot use an indexable as a mask",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-93-e2bb4c91224e>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mmovie_iloc\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mmovie\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0miloc\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mcriteria\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;31m# iloc不行，因为criteria是Series，iloc可以用布尔数组做索引。\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;32mc:\\users\\lin\\appdata\\local\\programs\\python\\python38-32\\lib\\site-packages\\pandas\\core\\indexing.py\u001b[0m in \u001b[0;36m__getitem__\u001b[1;34m(self, key)\u001b[0m\n\u001b[0;32m   1766\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1767\u001b[0m             \u001b[0mmaybe_callable\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mcom\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mapply_if_callable\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mobj\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 1768\u001b[1;33m             \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_getitem_axis\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mmaybe_callable\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0maxis\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   1769\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1770\u001b[0m     \u001b[1;32mdef\u001b[0m \u001b[0m_is_scalar_access\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mkey\u001b[0m\u001b[1;33m:\u001b[0m \u001b[0mTuple\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mc:\\users\\lin\\appdata\\local\\programs\\python\\python38-32\\lib\\site-packages\\pandas\\core\\indexing.py\u001b[0m in \u001b[0;36m_getitem_axis\u001b[1;34m(self, key, axis)\u001b[0m\n\u001b[0;32m   2122\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   2123\u001b[0m         \u001b[1;32mif\u001b[0m \u001b[0mcom\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mis_bool_indexer\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 2124\u001b[1;33m             \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_validate_key\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   2125\u001b[0m             \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_getbool_axis\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0maxis\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   2126\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mc:\\users\\lin\\appdata\\local\\programs\\python\\python38-32\\lib\\site-packages\\pandas\\core\\indexing.py\u001b[0m in \u001b[0;36m_validate_key\u001b[1;34m(self, key, axis)\u001b[0m\n\u001b[0;32m   1983\u001b[0m                         \u001b[1;34m\"is not available\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1984\u001b[0m                     )\n\u001b[1;32m-> 1985\u001b[1;33m                 raise ValueError(\n\u001b[0m\u001b[0;32m   1986\u001b[0m                     \u001b[1;34m\"iLocation based boolean indexing cannot use \"\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1987\u001b[0m                     \u001b[1;34m\"an indexable as a mask\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mValueError\u001b[0m: iLocation based boolean indexing cannot use an indexable as a mask"
     ]
    }
   ],
   "source": [
    "movie_iloc = movie.iloc[criteria] # iloc不行，因为criteria是Series，iloc可以用布尔数组做索引。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "metadata": {},
   "outputs": [],
   "source": [
    "movie_iloc = movie.iloc[criteria.values] # criteria.values返回布尔数组"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 95,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "movie_iloc.equals(movie_loc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>color</th>\n",
       "      <th>director_name</th>\n",
       "      <th>num_critic_for_reviews</th>\n",
       "      <th>duration</th>\n",
       "      <th>director_facebook_likes</th>\n",
       "      <th>actor_3_facebook_likes</th>\n",
       "      <th>actor_2_name</th>\n",
       "      <th>actor_1_facebook_likes</th>\n",
       "      <th>gross</th>\n",
       "      <th>genres</th>\n",
       "      <th>actor_1_name</th>\n",
       "      <th>num_voted_users</th>\n",
       "      <th>cast_total_facebook_likes</th>\n",
       "      <th>actor_3_name</th>\n",
       "      <th>facenumber_in_poster</th>\n",
       "      <th>plot_keywords</th>\n",
       "      <th>movie_imdb_link</th>\n",
       "      <th>num_user_for_reviews</th>\n",
       "      <th>language</th>\n",
       "      <th>country</th>\n",
       "      <th>content_rating</th>\n",
       "      <th>budget</th>\n",
       "      <th>title_year</th>\n",
       "      <th>actor_2_facebook_likes</th>\n",
       "      <th>imdb_score</th>\n",
       "      <th>aspect_ratio</th>\n",
       "      <th>movie_facebook_likes</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>movie_title</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>The True Story of Puss'N Boots</th>\n",
       "      <td>Color</td>\n",
       "      <td>Jérôme Deschamps</td>\n",
       "      <td>4.0</td>\n",
       "      <td>80.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>André Wilms</td>\n",
       "      <td>44.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Adventure|Animation|Comedy</td>\n",
       "      <td>Yolande Moreau</td>\n",
       "      <td>753</td>\n",
       "      <td>53</td>\n",
       "      <td>Jérôme Deschamps</td>\n",
       "      <td>0.0</td>\n",
       "      <td>cartoon cat|cat|character name in title|puss i...</td>\n",
       "      <td>http://www.imdb.com/title/tt1239462/?ref_=fn_t...</td>\n",
       "      <td>24.0</td>\n",
       "      <td>English</td>\n",
       "      <td>France</td>\n",
       "      <td>G</td>\n",
       "      <td>25000000.0</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>2.9</td>\n",
       "      <td>NaN</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Doogal</th>\n",
       "      <td>Color</td>\n",
       "      <td>Dave Borthwick</td>\n",
       "      <td>31.0</td>\n",
       "      <td>77.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>593.0</td>\n",
       "      <td>Kylie Minogue</td>\n",
       "      <td>787.0</td>\n",
       "      <td>7382993.0</td>\n",
       "      <td>Adventure|Animation|Comedy|Family|Fantasy</td>\n",
       "      <td>Jimmy Fallon</td>\n",
       "      <td>3851</td>\n",
       "      <td>2185</td>\n",
       "      <td>Jon Stewart</td>\n",
       "      <td>0.0</td>\n",
       "      <td>diamond|lava|magic|mountain|sorcerer</td>\n",
       "      <td>http://www.imdb.com/title/tt0763304/?ref_=fn_t...</td>\n",
       "      <td>114.0</td>\n",
       "      <td>English</td>\n",
       "      <td>USA</td>\n",
       "      <td>G</td>\n",
       "      <td>20000000.0</td>\n",
       "      <td>2006.0</td>\n",
       "      <td>690.0</td>\n",
       "      <td>2.8</td>\n",
       "      <td>1.85</td>\n",
       "      <td>346</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Thomas and the Magic Railroad</th>\n",
       "      <td>Color</td>\n",
       "      <td>Britt Allcroft</td>\n",
       "      <td>47.0</td>\n",
       "      <td>85.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>402.0</td>\n",
       "      <td>Colm Feore</td>\n",
       "      <td>1000.0</td>\n",
       "      <td>15911333.0</td>\n",
       "      <td>Adventure|Comedy|Drama|Family|Fantasy</td>\n",
       "      <td>Mara Wilson</td>\n",
       "      <td>2855</td>\n",
       "      <td>2429</td>\n",
       "      <td>Peter Fonda</td>\n",
       "      <td>1.0</td>\n",
       "      <td>locomotive|magic|mountain|railroad|steam locom...</td>\n",
       "      <td>http://www.imdb.com/title/tt0205461/?ref_=fn_t...</td>\n",
       "      <td>119.0</td>\n",
       "      <td>English</td>\n",
       "      <td>UK</td>\n",
       "      <td>G</td>\n",
       "      <td>19000000.0</td>\n",
       "      <td>2000.0</td>\n",
       "      <td>539.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.85</td>\n",
       "      <td>663</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Barney's Great Adventure</th>\n",
       "      <td>Color</td>\n",
       "      <td>Steve Gomer</td>\n",
       "      <td>24.0</td>\n",
       "      <td>76.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>47.0</td>\n",
       "      <td>Kyla Pratt</td>\n",
       "      <td>595.0</td>\n",
       "      <td>11144518.0</td>\n",
       "      <td>Adventure|Family</td>\n",
       "      <td>Trevor Morgan</td>\n",
       "      <td>2724</td>\n",
       "      <td>1139</td>\n",
       "      <td>Shirley Douglas</td>\n",
       "      <td>0.0</td>\n",
       "      <td>apostrophe in title|critically bashed|hit on t...</td>\n",
       "      <td>http://www.imdb.com/title/tt0120598/?ref_=fn_t...</td>\n",
       "      <td>53.0</td>\n",
       "      <td>English</td>\n",
       "      <td>Canada</td>\n",
       "      <td>G</td>\n",
       "      <td>15000000.0</td>\n",
       "      <td>1998.0</td>\n",
       "      <td>417.0</td>\n",
       "      <td>2.8</td>\n",
       "      <td>1.85</td>\n",
       "      <td>436</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Justin Bieber: Never Say Never</th>\n",
       "      <td>Color</td>\n",
       "      <td>Jon M. Chu</td>\n",
       "      <td>84.0</td>\n",
       "      <td>115.0</td>\n",
       "      <td>209.0</td>\n",
       "      <td>41.0</td>\n",
       "      <td>Sean Kingston</td>\n",
       "      <td>569.0</td>\n",
       "      <td>73000942.0</td>\n",
       "      <td>Documentary|Music</td>\n",
       "      <td>Usher Raymond</td>\n",
       "      <td>74351</td>\n",
       "      <td>714</td>\n",
       "      <td>Boys II Men</td>\n",
       "      <td>1.0</td>\n",
       "      <td>boyhood friend|manager|plasma tv|prodigy|star</td>\n",
       "      <td>http://www.imdb.com/title/tt1702443/?ref_=fn_t...</td>\n",
       "      <td>233.0</td>\n",
       "      <td>English</td>\n",
       "      <td>USA</td>\n",
       "      <td>G</td>\n",
       "      <td>13000000.0</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>69.0</td>\n",
       "      <td>1.6</td>\n",
       "      <td>1.85</td>\n",
       "      <td>62000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Sunday School Musical</th>\n",
       "      <td>Color</td>\n",
       "      <td>Rachel Goldenberg</td>\n",
       "      <td>5.0</td>\n",
       "      <td>93.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>73.0</td>\n",
       "      <td>Mark Hengst</td>\n",
       "      <td>349.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Drama|Musical</td>\n",
       "      <td>Dustin Fitzsimons</td>\n",
       "      <td>602</td>\n",
       "      <td>631</td>\n",
       "      <td>Debra Lynn Hull</td>\n",
       "      <td>0.0</td>\n",
       "      <td>church|competition|high school|new school|pastor</td>\n",
       "      <td>http://www.imdb.com/title/tt1270792/?ref_=fn_t...</td>\n",
       "      <td>18.0</td>\n",
       "      <td>English</td>\n",
       "      <td>USA</td>\n",
       "      <td>G</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2008.0</td>\n",
       "      <td>168.0</td>\n",
       "      <td>2.5</td>\n",
       "      <td>1.85</td>\n",
       "      <td>777</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                color      director_name  \\\n",
       "movie_title                                                \n",
       "The True Story of Puss'N Boots  Color   Jérôme Deschamps   \n",
       "Doogal                          Color     Dave Borthwick   \n",
       "Thomas and the Magic Railroad   Color     Britt Allcroft   \n",
       "Barney's Great Adventure        Color        Steve Gomer   \n",
       "Justin Bieber: Never Say Never  Color         Jon M. Chu   \n",
       "Sunday School Musical           Color  Rachel Goldenberg   \n",
       "\n",
       "                                num_critic_for_reviews  duration  \\\n",
       "movie_title                                                        \n",
       "The True Story of Puss'N Boots                     4.0      80.0   \n",
       "Doogal                                            31.0      77.0   \n",
       "Thomas and the Magic Railroad                     47.0      85.0   \n",
       "Barney's Great Adventure                          24.0      76.0   \n",
       "Justin Bieber: Never Say Never                    84.0     115.0   \n",
       "Sunday School Musical                              5.0      93.0   \n",
       "\n",
       "                                director_facebook_likes  \\\n",
       "movie_title                                               \n",
       "The True Story of Puss'N Boots                      0.0   \n",
       "Doogal                                              3.0   \n",
       "Thomas and the Magic Railroad                       2.0   \n",
       "Barney's Great Adventure                            9.0   \n",
       "Justin Bieber: Never Say Never                    209.0   \n",
       "Sunday School Musical                               7.0   \n",
       "\n",
       "                                actor_3_facebook_likes   actor_2_name  \\\n",
       "movie_title                                                             \n",
       "The True Story of Puss'N Boots                     0.0    André Wilms   \n",
       "Doogal                                           593.0  Kylie Minogue   \n",
       "Thomas and the Magic Railroad                    402.0     Colm Feore   \n",
       "Barney's Great Adventure                          47.0     Kyla Pratt   \n",
       "Justin Bieber: Never Say Never                    41.0  Sean Kingston   \n",
       "Sunday School Musical                             73.0    Mark Hengst   \n",
       "\n",
       "                                actor_1_facebook_likes       gross  \\\n",
       "movie_title                                                          \n",
       "The True Story of Puss'N Boots                    44.0         NaN   \n",
       "Doogal                                           787.0   7382993.0   \n",
       "Thomas and the Magic Railroad                   1000.0  15911333.0   \n",
       "Barney's Great Adventure                         595.0  11144518.0   \n",
       "Justin Bieber: Never Say Never                   569.0  73000942.0   \n",
       "Sunday School Musical                            349.0         NaN   \n",
       "\n",
       "                                                                   genres  \\\n",
       "movie_title                                                                 \n",
       "The True Story of Puss'N Boots                 Adventure|Animation|Comedy   \n",
       "Doogal                          Adventure|Animation|Comedy|Family|Fantasy   \n",
       "Thomas and the Magic Railroad       Adventure|Comedy|Drama|Family|Fantasy   \n",
       "Barney's Great Adventure                                 Adventure|Family   \n",
       "Justin Bieber: Never Say Never                          Documentary|Music   \n",
       "Sunday School Musical                                       Drama|Musical   \n",
       "\n",
       "                                     actor_1_name  num_voted_users  \\\n",
       "movie_title                                                          \n",
       "The True Story of Puss'N Boots     Yolande Moreau              753   \n",
       "Doogal                               Jimmy Fallon             3851   \n",
       "Thomas and the Magic Railroad         Mara Wilson             2855   \n",
       "Barney's Great Adventure            Trevor Morgan             2724   \n",
       "Justin Bieber: Never Say Never      Usher Raymond            74351   \n",
       "Sunday School Musical           Dustin Fitzsimons              602   \n",
       "\n",
       "                                cast_total_facebook_likes      actor_3_name  \\\n",
       "movie_title                                                                   \n",
       "The True Story of Puss'N Boots                         53  Jérôme Deschamps   \n",
       "Doogal                                               2185       Jon Stewart   \n",
       "Thomas and the Magic Railroad                        2429       Peter Fonda   \n",
       "Barney's Great Adventure                             1139   Shirley Douglas   \n",
       "Justin Bieber: Never Say Never                        714       Boys II Men   \n",
       "Sunday School Musical                                 631   Debra Lynn Hull   \n",
       "\n",
       "                                facenumber_in_poster  \\\n",
       "movie_title                                            \n",
       "The True Story of Puss'N Boots                   0.0   \n",
       "Doogal                                           0.0   \n",
       "Thomas and the Magic Railroad                    1.0   \n",
       "Barney's Great Adventure                         0.0   \n",
       "Justin Bieber: Never Say Never                   1.0   \n",
       "Sunday School Musical                            0.0   \n",
       "\n",
       "                                                                    plot_keywords  \\\n",
       "movie_title                                                                         \n",
       "The True Story of Puss'N Boots  cartoon cat|cat|character name in title|puss i...   \n",
       "Doogal                                       diamond|lava|magic|mountain|sorcerer   \n",
       "Thomas and the Magic Railroad   locomotive|magic|mountain|railroad|steam locom...   \n",
       "Barney's Great Adventure        apostrophe in title|critically bashed|hit on t...   \n",
       "Justin Bieber: Never Say Never      boyhood friend|manager|plasma tv|prodigy|star   \n",
       "Sunday School Musical            church|competition|high school|new school|pastor   \n",
       "\n",
       "                                                                  movie_imdb_link  \\\n",
       "movie_title                                                                         \n",
       "The True Story of Puss'N Boots  http://www.imdb.com/title/tt1239462/?ref_=fn_t...   \n",
       "Doogal                          http://www.imdb.com/title/tt0763304/?ref_=fn_t...   \n",
       "Thomas and the Magic Railroad   http://www.imdb.com/title/tt0205461/?ref_=fn_t...   \n",
       "Barney's Great Adventure        http://www.imdb.com/title/tt0120598/?ref_=fn_t...   \n",
       "Justin Bieber: Never Say Never  http://www.imdb.com/title/tt1702443/?ref_=fn_t...   \n",
       "Sunday School Musical           http://www.imdb.com/title/tt1270792/?ref_=fn_t...   \n",
       "\n",
       "                                num_user_for_reviews language country  \\\n",
       "movie_title                                                             \n",
       "The True Story of Puss'N Boots                  24.0  English  France   \n",
       "Doogal                                         114.0  English     USA   \n",
       "Thomas and the Magic Railroad                  119.0  English      UK   \n",
       "Barney's Great Adventure                        53.0  English  Canada   \n",
       "Justin Bieber: Never Say Never                 233.0  English     USA   \n",
       "Sunday School Musical                           18.0  English     USA   \n",
       "\n",
       "                               content_rating      budget  title_year  \\\n",
       "movie_title                                                             \n",
       "The True Story of Puss'N Boots              G  25000000.0      2009.0   \n",
       "Doogal                                      G  20000000.0      2006.0   \n",
       "Thomas and the Magic Railroad               G  19000000.0      2000.0   \n",
       "Barney's Great Adventure                    G  15000000.0      1998.0   \n",
       "Justin Bieber: Never Say Never              G  13000000.0      2011.0   \n",
       "Sunday School Musical                       G         NaN      2008.0   \n",
       "\n",
       "                                actor_2_facebook_likes  imdb_score  \\\n",
       "movie_title                                                          \n",
       "The True Story of Puss'N Boots                     9.0         2.9   \n",
       "Doogal                                           690.0         2.8   \n",
       "Thomas and the Magic Railroad                    539.0         3.6   \n",
       "Barney's Great Adventure                         417.0         2.8   \n",
       "Justin Bieber: Never Say Never                    69.0         1.6   \n",
       "Sunday School Musical                            168.0         2.5   \n",
       "\n",
       "                                aspect_ratio  movie_facebook_likes  \n",
       "movie_title                                                         \n",
       "The True Story of Puss'N Boots           NaN                    90  \n",
       "Doogal                                  1.85                   346  \n",
       "Thomas and the Magic Railroad           1.85                   663  \n",
       "Barney's Great Adventure                1.85                   436  \n",
       "Justin Bieber: Never Say Never          1.85                 62000  \n",
       "Sunday School Musical                   1.85                   777  "
      ]
     },
     "execution_count": 96,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "movie.loc[criteria.values] # 效果相同"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "color                      False\n",
       "director_name              False\n",
       "num_critic_for_reviews     False\n",
       "duration                   False\n",
       "director_facebook_likes    False\n",
       "dtype: bool"
      ]
     },
     "execution_count": 97,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "criteria_col = (movie.dtypes == np.int64)\n",
    "criteria_col.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 98,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>num_voted_users</th>\n",
       "      <th>cast_total_facebook_likes</th>\n",
       "      <th>movie_facebook_likes</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>movie_title</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Avatar</th>\n",
       "      <td>886204</td>\n",
       "      <td>4834</td>\n",
       "      <td>33000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Pirates of the Caribbean: At World's End</th>\n",
       "      <td>471220</td>\n",
       "      <td>48350</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Spectre</th>\n",
       "      <td>275868</td>\n",
       "      <td>11700</td>\n",
       "      <td>85000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>The Dark Knight Rises</th>\n",
       "      <td>1144337</td>\n",
       "      <td>106759</td>\n",
       "      <td>164000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Star Wars: Episode VII - The Force Awakens</th>\n",
       "      <td>8</td>\n",
       "      <td>143</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                            num_voted_users  \\\n",
       "movie_title                                                   \n",
       "Avatar                                               886204   \n",
       "Pirates of the Caribbean: At World's End             471220   \n",
       "Spectre                                              275868   \n",
       "The Dark Knight Rises                               1144337   \n",
       "Star Wars: Episode VII - The Force Awakens                8   \n",
       "\n",
       "                                            cast_total_facebook_likes  \\\n",
       "movie_title                                                             \n",
       "Avatar                                                           4834   \n",
       "Pirates of the Caribbean: At World's End                        48350   \n",
       "Spectre                                                         11700   \n",
       "The Dark Knight Rises                                          106759   \n",
       "Star Wars: Episode VII - The Force Awakens                        143   \n",
       "\n",
       "                                            movie_facebook_likes  \n",
       "movie_title                                                       \n",
       "Avatar                                                     33000  \n",
       "Pirates of the Caribbean: At World's End                       0  \n",
       "Spectre                                                    85000  \n",
       "The Dark Knight Rises                                     164000  \n",
       "Star Wars: Episode VII - The Force Awakens                     0  "
      ]
     },
     "execution_count": 98,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "movie.loc[:, criteria_col].head() # 只选择int64类型的列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>num_voted_users</th>\n",
       "      <th>cast_total_facebook_likes</th>\n",
       "      <th>movie_facebook_likes</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>movie_title</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Avatar</th>\n",
       "      <td>886204</td>\n",
       "      <td>4834</td>\n",
       "      <td>33000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Pirates of the Caribbean: At World's End</th>\n",
       "      <td>471220</td>\n",
       "      <td>48350</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Spectre</th>\n",
       "      <td>275868</td>\n",
       "      <td>11700</td>\n",
       "      <td>85000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>The Dark Knight Rises</th>\n",
       "      <td>1144337</td>\n",
       "      <td>106759</td>\n",
       "      <td>164000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Star Wars: Episode VII - The Force Awakens</th>\n",
       "      <td>8</td>\n",
       "      <td>143</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                            num_voted_users  \\\n",
       "movie_title                                                   \n",
       "Avatar                                               886204   \n",
       "Pirates of the Caribbean: At World's End             471220   \n",
       "Spectre                                              275868   \n",
       "The Dark Knight Rises                               1144337   \n",
       "Star Wars: Episode VII - The Force Awakens                8   \n",
       "\n",
       "                                            cast_total_facebook_likes  \\\n",
       "movie_title                                                             \n",
       "Avatar                                                           4834   \n",
       "Pirates of the Caribbean: At World's End                        48350   \n",
       "Spectre                                                         11700   \n",
       "The Dark Knight Rises                                          106759   \n",
       "Star Wars: Episode VII - The Force Awakens                        143   \n",
       "\n",
       "                                            movie_facebook_likes  \n",
       "movie_title                                                       \n",
       "Avatar                                                     33000  \n",
       "Pirates of the Caribbean: At World's End                       0  \n",
       "Spectre                                                    85000  \n",
       "The Dark Knight Rises                                     164000  \n",
       "Star Wars: Episode VII - The Force Awakens                     0  "
      ]
     },
     "execution_count": 99,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "movie.iloc[:, criteria_col.values].head() # 不管loc和iloc都能处理布尔数组索引"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>content_rating</th>\n",
       "      <th>imdb_score</th>\n",
       "      <th>title_year</th>\n",
       "      <th>gross</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>movie_title</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Justin Bieber: Never Say Never</th>\n",
       "      <td>G</td>\n",
       "      <td>1.6</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>73000942.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Sunday School Musical</th>\n",
       "      <td>G</td>\n",
       "      <td>2.5</td>\n",
       "      <td>2008.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Doogal</th>\n",
       "      <td>G</td>\n",
       "      <td>2.8</td>\n",
       "      <td>2006.0</td>\n",
       "      <td>7382993.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Barney's Great Adventure</th>\n",
       "      <td>G</td>\n",
       "      <td>2.8</td>\n",
       "      <td>1998.0</td>\n",
       "      <td>11144518.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>The True Story of Puss'N Boots</th>\n",
       "      <td>G</td>\n",
       "      <td>2.9</td>\n",
       "      <td>2009.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Thomas and the Magic Railroad</th>\n",
       "      <td>G</td>\n",
       "      <td>3.6</td>\n",
       "      <td>2000.0</td>\n",
       "      <td>15911333.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                               content_rating  imdb_score  title_year  \\\n",
       "movie_title                                                             \n",
       "Justin Bieber: Never Say Never              G         1.6      2011.0   \n",
       "Sunday School Musical                       G         2.5      2008.0   \n",
       "Doogal                                      G         2.8      2006.0   \n",
       "Barney's Great Adventure                    G         2.8      1998.0   \n",
       "The True Story of Puss'N Boots              G         2.9      2009.0   \n",
       "Thomas and the Magic Railroad               G         3.6      2000.0   \n",
       "\n",
       "                                     gross  \n",
       "movie_title                                 \n",
       "Justin Bieber: Never Say Never  73000942.0  \n",
       "Sunday School Musical                  NaN  \n",
       "Doogal                           7382993.0  \n",
       "Barney's Great Adventure        11144518.0  \n",
       "The True Story of Puss'N Boots         NaN  \n",
       "Thomas and the Magic Railroad   15911333.0  "
      ]
     },
     "execution_count": 100,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cols = ['content_rating', 'imdb_score', 'title_year', 'gross']\n",
    "movie.loc[criteria, cols].sort_values('imdb_score')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 101,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[20, 24, 22, 8]"
      ]
     },
     "execution_count": 101,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "col_index = [movie.columns.get_loc(col) for col in cols] # get_loc获得列的位置，即第几列。\n",
    "col_index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 102,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([False, False, False, False, False])"
      ]
     },
     "execution_count": 102,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a = criteria.values\n",
    "a[:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 103,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(4916, 4916)"
      ]
     },
     "execution_count": 103,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(a), len(criteria)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "metadata": {},
   "outputs": [
    {
     "ename": "IndexError",
     "evalue": "Boolean index has wrong length: 3 instead of 4916",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mIndexError\u001b[0m                                Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-104-aec1f103fae6>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[1;31m# 现在的版本不支持了，因为行列长度不匹配。\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0mmovie\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mloc\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;32mTrue\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;32mFalse\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;32mTrue\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m[\u001b[0m\u001b[1;32mTrue\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;32mFalse\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;32mFalse\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;32mTrue\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;32mc:\\users\\lin\\appdata\\local\\programs\\python\\python38-32\\lib\\site-packages\\pandas\\core\\indexing.py\u001b[0m in \u001b[0;36m__getitem__\u001b[1;34m(self, key)\u001b[0m\n\u001b[0;32m   1760\u001b[0m                 \u001b[1;32mexcept\u001b[0m \u001b[1;33m(\u001b[0m\u001b[0mKeyError\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mIndexError\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mAttributeError\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1761\u001b[0m                     \u001b[1;32mpass\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 1762\u001b[1;33m             \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_getitem_tuple\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   1763\u001b[0m         \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1764\u001b[0m             \u001b[1;31m# we by definition only have the 0th axis\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mc:\\users\\lin\\appdata\\local\\programs\\python\\python38-32\\lib\\site-packages\\pandas\\core\\indexing.py\u001b[0m in \u001b[0;36m_getitem_tuple\u001b[1;34m(self, tup)\u001b[0m\n\u001b[0;32m   1287\u001b[0m                 \u001b[1;32mcontinue\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1288\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 1289\u001b[1;33m             \u001b[0mretval\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mgetattr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mretval\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_getitem_axis\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   1290\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1291\u001b[0m         \u001b[1;32mreturn\u001b[0m \u001b[0mretval\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mc:\\users\\lin\\appdata\\local\\programs\\python\\python38-32\\lib\\site-packages\\pandas\\core\\indexing.py\u001b[0m in \u001b[0;36m_getitem_axis\u001b[1;34m(self, key, axis)\u001b[0m\n\u001b[0;32m   1912\u001b[0m             \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_get_slice_axis\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0maxis\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1913\u001b[0m         \u001b[1;32melif\u001b[0m \u001b[0mcom\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mis_bool_indexer\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 1914\u001b[1;33m             \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_getbool_axis\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0maxis\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   1915\u001b[0m         \u001b[1;32melif\u001b[0m \u001b[0mis_list_like_indexer\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1916\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mc:\\users\\lin\\appdata\\local\\programs\\python\\python38-32\\lib\\site-packages\\pandas\\core\\indexing.py\u001b[0m in \u001b[0;36m_getbool_axis\u001b[1;34m(self, key, axis)\u001b[0m\n\u001b[0;32m   1780\u001b[0m         \u001b[1;31m# caller is responsible for ensuring non-None axis\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1781\u001b[0m         \u001b[0mlabels\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mobj\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_get_axis\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0maxis\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 1782\u001b[1;33m         \u001b[0mkey\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mcheck_bool_indexer\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mlabels\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mkey\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   1783\u001b[0m         \u001b[0minds\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mkey\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mnonzero\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1784\u001b[0m         \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mobj\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_take_with_is_copy\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0minds\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0maxis\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mc:\\users\\lin\\appdata\\local\\programs\\python\\python38-32\\lib\\site-packages\\pandas\\core\\indexing.py\u001b[0m in \u001b[0;36mcheck_bool_indexer\u001b[1;34m(index, key)\u001b[0m\n\u001b[0;32m   2326\u001b[0m         \u001b[0mresult\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mcheck_array_indexer\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mindex\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mresult\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   2327\u001b[0m     \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 2328\u001b[1;33m         \u001b[0mresult\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mcheck_array_indexer\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mindex\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mresult\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   2329\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   2330\u001b[0m     \u001b[1;32mreturn\u001b[0m \u001b[0mresult\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mc:\\users\\lin\\appdata\\local\\programs\\python\\python38-32\\lib\\site-packages\\pandas\\core\\indexers.py\u001b[0m in \u001b[0;36mcheck_array_indexer\u001b[1;34m(array, indexer)\u001b[0m\n\u001b[0;32m    398\u001b[0m         \u001b[1;31m# GH26658\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    399\u001b[0m         \u001b[1;32mif\u001b[0m \u001b[0mlen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mindexer\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;33m!=\u001b[0m \u001b[0mlen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0marray\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 400\u001b[1;33m             raise IndexError(\n\u001b[0m\u001b[0;32m    401\u001b[0m                 \u001b[1;34mf\"Boolean index has wrong length: \"\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    402\u001b[0m                 \u001b[1;34mf\"{len(indexer)} instead of {len(array)}\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mIndexError\u001b[0m: Boolean index has wrong length: 3 instead of 4916"
     ]
    }
   ],
   "source": [
    "# 现在的版本不支持了，因为行列长度不匹配。\n",
    "movie.loc[[True, False, True], [True, False, False, True]]"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.2"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
